Thalhammer / jwt-cpp

A header only library for creating and validating json web tokens in c++
https://thalhammer.github.io/jwt-cpp/
MIT License
875 stars 239 forks source link

unexpected exception(expired) throws in verify JWT token #354

Closed quanchentg closed 3 months ago

quanchentg commented 3 months ago

What's your question?

unexpected exception(expired) throws in verify JWT token

Additional Context

Fist of all, very appreciate for jwt-cpp, it is awesome!

i have a function called validateJWTtoken(jwttoken)

before start using

try { verifier.verify(decoded_token); } catch (const jwt::error::token_verification_exception& ex) { .... } i have a expiration check such as

if (expiration_time <= seconds_since_epoch) { ... }

the strange thing is the jwt token passed in this function can always pass my expiration check but sometimes (very random) failed in the verifier.verify(decoded_token) and throws token expired exception.

could you please give me some clue on it? Thank you.

quanchentg commented 3 months ago

nvm, i figure it out.

prince-chrismc commented 3 months ago

very appreciate for jwt-cpp, it is awesome!

Thanks!