Skip to main content

expires_at_ms

Function expires_at_ms 

Source
pub fn expires_at_ms(now_ms: f64, expires_in_secs: i64) -> f64
Expand description

Compute the absolute expiry (Date.now()-domain milliseconds) for a token whose expires_in (seconds, RFC 6749 §5.1) is expires_in_secs relative to now_ms. A non-positive expires_in clamps to now_ms (already expired) rather than underflowing.