diff --git a/api/src/utils/auth-utils.ts b/api/src/utils/auth-utils.ts index c283cc49f..47c0364f4 100644 --- a/api/src/utils/auth-utils.ts +++ b/api/src/utils/auth-utils.ts @@ -81,7 +81,7 @@ export const authenticate = async (req: InvasivesRequest) => { MDC.additionalContext.isPublicURL = isPublicURL; - let token; + let token: string; try { token = authHeader.split(/\s/)[1]; @@ -89,7 +89,7 @@ export const authenticate = async (req: InvasivesRequest) => { defaultLog.info({ label: 'authenticate', message: 'malformed auth token received' }); throw { - code: 401, + code: 400, message: 'Authorization header parse failure', namespace: 'auth-utils' };