diff --git a/crates/router/src/consts.rs b/crates/router/src/consts.rs index 40c37547a2e4..12b688e3d3ab 100644 --- a/crates/router/src/consts.rs +++ b/crates/router/src/consts.rs @@ -66,10 +66,8 @@ pub const ROUTING_CONFIG_ID_LENGTH: usize = 10; pub const LOCKER_REDIS_PREFIX: &str = "LOCKER_PM_TOKEN"; pub const LOCKER_REDIS_EXPIRY_SECONDS: u32 = 60 * 15; // 15 minutes -// #[cfg(any(feature = "olap", feature = "oltp"))] pub const JWT_TOKEN_TIME_IN_SECS: u64 = 60 * 60 * 24 * 2; // 2 days -// #[cfg(any(feature = "olap", feature = "oltp"))] pub const USER_BLACKLIST_PREFIX: &str = "BU_"; #[cfg(feature = "email")] diff --git a/crates/router/src/services/authentication/blacklist.rs b/crates/router/src/services/authentication/blacklist.rs index ff8a4a36b879..118a2c33d3fd 100644 --- a/crates/router/src/services/authentication/blacklist.rs +++ b/crates/router/src/services/authentication/blacklist.rs @@ -5,24 +5,25 @@ use common_utils::date_time; use error_stack::{IntoReport, ResultExt}; use redis_interface::RedisConnectionPool; -#[cfg(feature = "olap")] -use crate::core::errors::{UserErrors, UserResult}; -#[cfg(feature = "olap")] -use crate::routes::AppState; use crate::{ consts::{JWT_TOKEN_TIME_IN_SECS, USER_BLACKLIST_PREFIX}, core::errors::{ApiErrorResponse, RouterResult}, routes::app::AppStateInfo, }; +#[cfg(feature = "olap")] +use crate::{ + core::errors::{UserErrors, UserResult}, + routes::AppState, +}; #[cfg(feature = "olap")] pub async fn insert_user_in_blacklist(state: &AppState, user_id: &str) -> UserResult<()> { - let token = format!("{}{}", USER_BLACKLIST_PREFIX, user_id); + let user_blacklist_key = format!("{}{}", USER_BLACKLIST_PREFIX, user_id); let expiry = expiry_to_i64(JWT_TOKEN_TIME_IN_SECS).change_context(UserErrors::InternalServerError)?; let redis_conn = get_redis_connection(state).change_context(UserErrors::InternalServerError)?; redis_conn - .set_key_with_expiry(token.as_str(), date_time::now_unix_timestamp(), expiry) + .set_key_with_expiry(user_blacklist_key.as_str(), date_time::now_unix_timestamp(), expiry) .await .change_context(UserErrors::InternalServerError) } diff --git a/crates/router_env/src/logger/types.rs b/crates/router_env/src/logger/types.rs index 17c2be0fec4b..c78455ffbe6c 100644 --- a/crates/router_env/src/logger/types.rs +++ b/crates/router_env/src/logger/types.rs @@ -285,7 +285,7 @@ pub enum Flow { FrmFulfillment, /// Change password flow ChangePassword, - /// Signout Flow + /// Signout flow Signout, /// Set Dashboard Metadata flow SetDashboardMetadata,