mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
feat(core): Prevent session hijacking (#9057)
This commit is contained in:
committed by
GitHub
parent
5793e5644a
commit
28261047c3
@@ -33,7 +33,7 @@ import {
|
||||
TEMPLATES_DIR,
|
||||
} from '@/constants';
|
||||
import { CredentialsController } from '@/credentials/credentials.controller';
|
||||
import type { CurlHelper } from '@/requests';
|
||||
import type { APIRequest, CurlHelper } from '@/requests';
|
||||
import { registerController } from '@/decorators';
|
||||
import { AuthController } from '@/controllers/auth.controller';
|
||||
import { BinaryDataController } from '@/controllers/binaryData.controller';
|
||||
@@ -235,6 +235,13 @@ export class Server extends AbstractServer {
|
||||
frontendService.settings.publicApi.latestVersion = apiLatestVersion;
|
||||
}
|
||||
}
|
||||
|
||||
// Extract BrowserId from headers
|
||||
this.app.use((req: APIRequest, _, next) => {
|
||||
req.browserId = req.headers['browser-id'] as string;
|
||||
next();
|
||||
});
|
||||
|
||||
// Parse cookies for easier access
|
||||
this.app.use(cookieParser());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user