I found an error message "token has invalid claims: token is expired" #377
-
If I set ExpiresAt equal to 0 when SignedString and after that I ParseWithClaims After that it has an error that "token has invalid claims: token is expired" It seems like jwt.ErrTokenInvalidClaims + ":" + jwt.ErrTokenExpired, Why is it not only equal to jwt.ErrTokenExpired? And I try to set ExpiresAt equal to a day. But it does not have an error. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Could you elaborate what you mean with "equal to 0"? Are you using With regards to the error, we are using wrapped errors, so you should not compare it directly against Lines 181 to 183 in 6bcdd9d |
Beta Was this translation helpful? Give feedback.
Ok got it. as mentioned, in this case you can use
errors.Is(err, jwt.ErrTokenExpired)
to check for an expired token.