Extract the `exp` claim from a JWT without full validation.
(token: &str)
| 110 | |
| 111 | /// Extract the `exp` claim from a JWT without full validation. |
| 112 | fn extract_exp_from_token(token: &str) -> Option<u64> { |
| 113 | let parts: Vec<&str> = token.split('.').collect(); |
| 114 | if parts.len() != 3 { |
| 115 | return None; |
| 116 | } |
| 117 | let payload = base64_url_decode(parts[1])?; |
| 118 | let claims: serde_json::Value = sonic_rs::from_slice(&payload).ok()?; |
| 119 | claims.get("exp")?.as_u64() |
| 120 | } |
| 121 | |
| 122 | /// Reason a sync delta was silently rejected. |
| 123 | #[derive(Debug, Clone)] |