mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
refactor(core)!: Remove basic-auth, external-jwt-auth, and no-auth options (#6362)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
committed by
कारतोफ्फेलस्क्रिप्ट™
parent
a45a2c8c41
commit
8c008f5d22
@@ -57,11 +57,7 @@ export const setupPushServer = (restEndpoint: string, server: Server, app: Appli
|
||||
}
|
||||
};
|
||||
|
||||
export const setupPushHandler = (
|
||||
restEndpoint: string,
|
||||
app: Application,
|
||||
isUserManagementEnabled: boolean,
|
||||
) => {
|
||||
export const setupPushHandler = (restEndpoint: string, app: Application) => {
|
||||
const endpoint = `/${restEndpoint}/push`;
|
||||
|
||||
const pushValidationMiddleware: RequestHandler = async (
|
||||
@@ -83,20 +79,19 @@ export const setupPushHandler = (
|
||||
}
|
||||
|
||||
// Handle authentication
|
||||
if (isUserManagementEnabled) {
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
||||
const authCookie: string = req.cookies?.[AUTH_COOKIE_NAME] ?? '';
|
||||
await resolveJwt(authCookie);
|
||||
} catch (error) {
|
||||
if (ws) {
|
||||
ws.send(`Unauthorized: ${(error as Error).message}`);
|
||||
ws.close(401);
|
||||
} else {
|
||||
res.status(401).send('Unauthorized');
|
||||
}
|
||||
return;
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
||||
const authCookie: string = req.cookies?.[AUTH_COOKIE_NAME] ?? '';
|
||||
await resolveJwt(authCookie);
|
||||
} catch (error) {
|
||||
if (ws) {
|
||||
ws.send(`Unauthorized: ${(error as Error).message}`);
|
||||
ws.close(401);
|
||||
} else {
|
||||
res.status(401).send('Unauthorized');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user