Skip to content

Commit

Permalink
Await async jwt.verify function
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc authored Feb 6, 2023
1 parent 92b7a26 commit fdf2d5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export const expressjwt = (options: Params) => {
const key = await getVerificationKey(req, decodedToken);

try {
jwt.verify(token, key, options);
await jwt.verify(token, key, options);
} catch (err) {
const wrappedErr = new UnauthorizedError('invalid_token', err);
if (err instanceof jwt.TokenExpiredError && typeof options.onExpired === 'function') {
Expand Down

0 comments on commit fdf2d5c

Please sign in to comment.