How to check if the error reason is jwt Token Expiry ? #608
Unanswered
geminigeek
asked this question in
Q&A
Replies: 1 comment
-
Hey @geminigeek — we're using https://github.com/payloadcms/payload/blob/master/src/auth/strategies/jwt.ts A quick check through their docs does not show a way to discern between if the token is expired, missing, or invalid. In the future, we'll be building a way to add your own auth strategies though - so when we have that, you'd be able to build a strategy however you want. But for now, I think your middleware idea is probably the best bet. |
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
-
hi,
i am using only jwt tokens for auth ( no cookies ), i want to know if there is a way to find that the token has expired ?
i want to trigger an action if token has expired before sending the errors.
i can check myself in a custom middleware using jwt and secret but is there a way natively in payload for this ?
thanks
Dee
Beta Was this translation helpful? Give feedback.
All reactions