I noticed validation was succeeding even though the expiration of my token had passed well beforehand.
Looking at the code, the timestamp compared to exp is computed in validation.rs as follows:
pub fn get_current_timestamp() -> u64 {
let start = SystemTime::now();
start.duration_since(UNIX_EPOCH).expect("Time went backwards").as_secs()
}
I believe the problem is that the timestamp is obtained from SystemTime::now(). This returns a non-UTC timestamp in my system (Corresponding to the local time zone).
I noticed validation was succeeding even though the expiration of my token had passed well beforehand.
Looking at the code, the timestamp compared to
exp
is computed in validation.rs as follows:I believe the problem is that the timestamp is obtained from
SystemTime::now()
. This returns a non-UTC timestamp in my system (Corresponding to the local time zone).