diff --git a/crates/handlers/src/oauth2/introspection.rs b/crates/handlers/src/oauth2/introspection.rs index f67676720..608871e54 100644 --- a/crates/handlers/src/oauth2/introspection.rs +++ b/crates/handlers/src/oauth2/introspection.rs @@ -284,7 +284,7 @@ pub(crate) async fn post( exp: access_token.expires_at, expires_in: access_token .expires_at - .map(|expires_at| expires_at.signed_duration_since(clock.now()).num_seconds()), + .map(|expires_at| expires_at.signed_duration_since(clock.now())), iat: Some(access_token.created_at), nbf: Some(access_token.created_at), sub, @@ -421,7 +421,7 @@ pub(crate) async fn post( exp: access_token.expires_at, expires_in: access_token .expires_at - .map(|expires_at| expires_at.signed_duration_since(clock.now()).num_seconds()), + .map(|expires_at| expires_at.signed_duration_since(clock.now())), iat: Some(access_token.created_at), nbf: Some(access_token.created_at), sub: Some(user.sub), diff --git a/crates/oauth2-types/src/requests.rs b/crates/oauth2-types/src/requests.rs index a4246e9b4..631b33309 100644 --- a/crates/oauth2-types/src/requests.rs +++ b/crates/oauth2-types/src/requests.rs @@ -769,7 +769,8 @@ pub struct IntrospectionResponse { /// Relative timestamp indicating when the token will expire, /// in seconds from the current instant. - pub expires_in: Option, + #[serde_as(as = "Option>")] + pub expires_in: Option, /// Timestamp indicating when the token was issued. #[serde_as(as = "Option")]