From 32afe3f89372063b974f56bf1fd65afa20ab5bf6 Mon Sep 17 00:00:00 2001 From: Tolmachev Igor Date: Sun, 7 Dec 2025 02:04:56 +0300 Subject: Rename field --- src/routers/account.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/routers') diff --git a/src/routers/account.rs b/src/routers/account.rs index e39327a..14bc25b 100644 --- a/src/routers/account.rs +++ b/src/routers/account.rs @@ -24,7 +24,7 @@ use crate::{ struct Token { #[schema(examples("eyJ0eXAiO..."))] token: String, - expired_at: DateTime, + expiration_date: DateTime, } #[derive(Deserialize, ToSchema)] @@ -182,19 +182,22 @@ async fn login( return Err(ClientError::InvalidPassword.into()); } - let expired_at = Utc::now() + Duration::days(req.token_lifetime as i64); + let expiration_date = Utc::now() + Duration::days(req.token_lifetime as i64); let token = create_jwt( &JwtClaims { sub: user.id, iat: user.password_issue_date.and_utc().timestamp(), - exp: expired_at.timestamp(), + exp: expiration_date.timestamp(), }, &state.secret, ) .map_err(|e| ServerError::Token(e.to_string()))?; - Ok(SuccessResponse::ok(Token { token, expired_at })) + Ok(SuccessResponse::ok(Token { + token, + expiration_date, + })) } #[utoipa::path( -- cgit v1.2.3