Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #326 from WadeBarnes/fix/malformed-jwt-error
Browse files Browse the repository at this point in the history
Fix for error: jwt malformed {"name":"JsonWebTokenError"}
  • Loading branch information
swcurran authored Jan 10, 2022
2 parents 4540bf8 + d5d5197 commit cc6a8a3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/src/utils/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,9 @@ function extractIdToken(authHeader: string | undefined): string | undefined {
if (!authHeader || authHeader.split(" ").length === 1) {
return undefined;
}
return authHeader.split(" ")[1];
}
const token = authHeader.split(" ")[1];
if (token === 'null' || token === 'undefined') {
return undefined;
}
return token
}

0 comments on commit cc6a8a3

Please sign in to comment.