From cdedeccec3821a584233a8b700c379601439c339 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Wed, 30 Jul 2025 19:23:04 -0400 Subject: [PATCH] Using secret key from env file --- src/auth.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/auth.rs b/src/auth.rs index caa2c58..08f4ae7 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -85,10 +85,12 @@ pub async fn auth( (StatusCode::UNAUTHORIZED, Json(json_error)) })?; + let secret_key = icarus_envy::environment::get_secret_main_key().await; + let claims = decode::( &token, // TODO: Replace with code to get secret from env - &DecodingKey::from_secret("my_super_secret".as_ref()), + &DecodingKey::from_secret(secret_key.as_ref()), &Validation::default(), ) .map_err(|_| {