Replies: 1 comment
-
|
jwtVerify throws when the token is expired. Example: import { jwtVerify } from 'jose';
import { JWTExpired } from 'jose/errors';
try {
const { payload } = await jwtVerify(token, jwks, {
issuer,
audience,
algorithms: ['RS256'],
requiredClaims: ['exp'],
// optional: maxTokenAge: '15m',
});
return payload;
} catch (err) {
if (err instanceof JWTExpired) {
// expired
} else {
// other verification errors
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The docs are pretty vague or have no info on this, but is this way to catch an error thrown when a jwt is expired?
Is there an actual error thrown of this instance?
Assuming nothing is thrown the claim is always valid?
Beta Was this translation helpful? Give feedback.
All reactions