diff --git a/crates/bitwarden/src/auth/jwt_token.rs b/crates/bitwarden/src/auth/jwt_token.rs index 14cbaf84f..9097b84f2 100644 --- a/crates/bitwarden/src/auth/jwt_token.rs +++ b/crates/bitwarden/src/auth/jwt_token.rs @@ -13,6 +13,7 @@ use crate::{error::Result, util::BASE64_ENGINE}; /// TODO: We need to expand this to support user based JWT tokens. #[derive(serde::Deserialize)] pub struct JWTToken { + pub exp: u64, pub sub: String, pub email: Option, pub organization: Option, @@ -62,6 +63,7 @@ mod tests { f3LEddAPV8cAFza4DjA8pZJLFrMyRvMXcL_PjKF8qPVzqVWh03lfJ4clOIxR2gOuWIc902Y5E"; let token: JWTToken = jwt.parse().unwrap(); + assert_eq!(token.exp, 1675107177); assert_eq!(token.sub, "e25d37f3-b603-40de-84ba-af96012f5a42"); assert_eq!(token.email.as_deref(), Some("test@bitwarden.com")); assert_eq!(token.organization.as_deref(), None);