From 3c0c2f981dcf4d0bea26ae25ac8d20e02911f9a2 Mon Sep 17 00:00:00 2001 From: Darshit Chanpura Date: Mon, 11 Mar 2024 18:01:23 -0400 Subject: [PATCH] Removes unneeded usage of anonymous auth header constant Signed-off-by: Darshit Chanpura --- server/auth/types/authentication_type.ts | 2 ++ server/auth/types/basic/routes.ts | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/auth/types/authentication_type.ts b/server/auth/types/authentication_type.ts index 1b7d87cf6..14ca8ec27 100755 --- a/server/auth/types/authentication_type.ts +++ b/server/auth/types/authentication_type.ts @@ -114,6 +114,7 @@ export abstract class AuthenticationType implements IAuthenticationType { let cookie: SecuritySessionCookie | null | undefined; let authInfo: any | undefined; + // Adds a basic auth credentials headers to requests originated as anonymous user if (this.config.auth.anonymous_auth_enabled) { const anonymousAuthHeaders = { authorization: ANONYMOUS_AUTH_HEADER }; Object.assign(authHeaders, anonymousAuthHeaders); @@ -159,6 +160,7 @@ export abstract class AuthenticationType implements IAuthenticationType { if (request.url.pathname && request.url.pathname.startsWith('/bundles/')) { return toolkit.notHandled(); } + // send to auth workflow return this.handleUnauthedRequest(request, response, toolkit); } diff --git a/server/auth/types/basic/routes.ts b/server/auth/types/basic/routes.ts index aed5cf587..4370c63a3 100755 --- a/server/auth/types/basic/routes.ts +++ b/server/auth/types/basic/routes.ts @@ -212,7 +212,6 @@ export class BasicAuthRoutes { }; if (user.multitenancy_enabled) { - request.headers.authorization = ANONYMOUS_AUTH_HEADER; const selectTenant = resolveTenant({ request, username: user.username, @@ -231,7 +230,6 @@ export class BasicAuthRoutes { return response.redirected({ headers: { location: `${redirectUrl}`, - authorization: ANONYMOUS_AUTH_HEADER, }, }); } else {