Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear invalid session cookies #22327

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/orange-planets-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---

Check warning on line 1 in .changeset/orange-planets-type.md

View workflow job for this annotation

GitHub Actions / Lint

File ignored by default.
'@directus/api': patch
---

Added clearing of invalid session cookies, enabling affected clients to perform requests (and especially login) again
5 changes: 1 addition & 4 deletions api/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ import emitter from './emitter.js';
import { getExtensionManager } from './extensions/index.js';
import { getFlowManager } from './flows.js';
import { createExpressLogger, useLogger } from './logger.js';
import authenticate from './middleware/authenticate.js';
import { authenticate } from './middleware/authenticate/index.js';
import cache from './middleware/cache.js';
import { checkIP } from './middleware/check-ip.js';
import cors from './middleware/cors.js';
import errorHandler from './middleware/error-handler.js';
import extractToken from './middleware/extract-token.js';
import getPermissions from './middleware/get-permissions.js';
import rateLimiterGlobal from './middleware/rate-limiter-global.js';
import rateLimiter from './middleware/rate-limiter-ip.js';
Expand Down Expand Up @@ -200,8 +199,6 @@ export default async function createApp(): Promise<express.Application> {

app.use(cookieParser());

app.use(extractToken);

app.get('/', (_req, res, next) => {
if (env['ROOT_REDIRECT']) {
res.redirect(env['ROOT_REDIRECT'] as string);
Expand Down
268 changes: 0 additions & 268 deletions api/src/middleware/authenticate.test.ts

This file was deleted.

53 changes: 0 additions & 53 deletions api/src/middleware/authenticate.ts

This file was deleted.