Use DurationSeconds
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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<i64>,
|
||||
#[serde_as(as = "Option<DurationSeconds<i64>>")]
|
||||
pub expires_in: Option<Duration>,
|
||||
|
||||
/// Timestamp indicating when the token was issued.
|
||||
#[serde_as(as = "Option<TimestampSeconds>")]
|
||||
|
||||
Reference in New Issue
Block a user