From 9fd6e01ea43dd7342fc581ad11ce86552477a9af Mon Sep 17 00:00:00 2001 From: Mani Chandra Dulam Date: Thu, 28 Nov 2024 23:22:38 +0530 Subject: [PATCH] fix: change >= to > to not set expiry as 0 --- crates/router/src/services/authorization.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/router/src/services/authorization.rs b/crates/router/src/services/authorization.rs index 9951c1b2f6c7..8f48ef068ce9 100644 --- a/crates/router/src/services/authorization.rs +++ b/crates/router/src/services/authorization.rs @@ -40,7 +40,7 @@ where i64::try_from(token.exp).change_context(ApiErrorResponse::InternalServerError)?; let cache_ttl = token_expiry - common_utils::date_time::now_unix_timestamp(); - if cache_ttl >= 0 { + if cache_ttl > 0 { set_role_info_in_cache(state, &token.role_id, &role_info, cache_ttl) .await .map_err(|e| logger::error!("Failed to set role info in cache {e:?}"))