Expected behavior upon JWT verification failure #735
-
| I am not sure what should happen when the verification using  const jwtPubKey = "..."
const key = await jose.importSPKI(jwtPubKey, "RS256");
try {
  const { payload, protectedHeader } = await jose.jwtVerify(token, key);
} catch (error) {
  console.log(error);
}For my use case, I need to determine when the verification fails. I assume there are different scenarios for verification failures (ex. expired JWT, signature mismatch and so on). | 
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
| The returned promise will only resolve when everything's in order. In all other cases the promise will reject. | 
Beta Was this translation helpful? Give feedback.
The returned promise will only resolve when everything's in order. In all other cases the promise will reject.