Skip to content

Commit

Permalink
Update packages/backend/src/open_payments/auth/middleware.ts
Browse files Browse the repository at this point in the history
`authorization` can still be undefined here, when the `canSkipAuthValidation` is false it won't enter the early return statement and will return 401 because of undefined authorization

Co-authored-by: Max Kurapov <[email protected]>
  • Loading branch information
DarianM and mkurapov authored Nov 1, 2024
1 parent e0909bf commit c242202
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/backend/src/open_payments/auth/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export function createTokenIntrospectionMiddleware({
return
}

const authSplit = ctx.request.headers.authorization?.split(' ')
const authSplit = ctx.request.headers.authorization.split(' ')
if (authSplit?.length !== 2 || authSplit[0] !== 'GNAP') {
throw new OpenPaymentsServerRouteError(
401,
Expand Down

0 comments on commit c242202

Please sign in to comment.