From fdf2d5c0f01f92496d6a01b4f6b6d50d3cefd481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Mon, 6 Feb 2023 18:26:25 +0200 Subject: [PATCH] Await async jwt.verify function --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index e21f91fe..7758f4b8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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') {