Apply Admin Session Lifetime to JWT

This commit is contained in:
Nils Mittler 2023-02-20 16:51:09 +01:00 committed by Daniel García
parent 2bb41367bc
commit 6fa1dc50be
No known key found for this signature in database
GPG key ID: FC8A7D14C3CD543A

View file

@ -241,7 +241,7 @@ pub fn generate_admin_claims() -> BasicJwtClaims {
let time_now = Utc::now().naive_utc(); let time_now = Utc::now().naive_utc();
BasicJwtClaims { BasicJwtClaims {
nbf: time_now.timestamp(), nbf: time_now.timestamp(),
exp: (time_now + Duration::minutes(20)).timestamp(), exp: (time_now + Duration::minutes(CONFIG.admin_cookie_lifetime())).timestamp(),
iss: JWT_ADMIN_ISSUER.to_string(), iss: JWT_ADMIN_ISSUER.to_string(),
sub: "admin_panel".to_string(), sub: "admin_panel".to_string(),
} }