Skip to content

Commit

Permalink
Removes unneeded usage of anonymous auth header constant
Browse files Browse the repository at this point in the history
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
  • Loading branch information
DarshitChanpura committed Mar 11, 2024
1 parent a0f2db4 commit 3c0c2f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions server/auth/types/authentication_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 0 additions & 2 deletions server/auth/types/basic/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ export class BasicAuthRoutes {
};

if (user.multitenancy_enabled) {
request.headers.authorization = ANONYMOUS_AUTH_HEADER;
const selectTenant = resolveTenant({
request,
username: user.username,
Expand All @@ -231,7 +230,6 @@ export class BasicAuthRoutes {
return response.redirected({
headers: {
location: `${redirectUrl}`,
authorization: ANONYMOUS_AUTH_HEADER,
},
});
} else {
Expand Down

0 comments on commit 3c0c2f9

Please sign in to comment.