Closed devinlyons closed 3 years ago
This causes issues if the token is generated in a different timezone, such as UTC
Times in a JWT should only be in UTC and this function gets the current UTC timestamp. I think the only possible issue is if your server is not in UTC?
I confirmed this with a little testing. I wish it was mentioned in the SystemTime
documentation. Thank you for looking at this!
SystemTime::new()
is used to validate thenbf
date in a token. This causes issues if the token is generated in a different timezone, such as UTC. I think this needs to be configurable so a timezone offset can be specified.https://github.com/Keats/jsonwebtoken/blob/2f25cbed0a906e091a278c10eeb6cc1cf30dc24a/src/validation.rs#L101