Using secret key from env file
This commit is contained in:
+3
-1
@@ -85,10 +85,12 @@ pub async fn auth<B>(
|
|||||||
(StatusCode::UNAUTHORIZED, Json(json_error))
|
(StatusCode::UNAUTHORIZED, Json(json_error))
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
let secret_key = icarus_envy::environment::get_secret_main_key().await;
|
||||||
|
|
||||||
let claims = decode::<UserClaims>(
|
let claims = decode::<UserClaims>(
|
||||||
&token,
|
&token,
|
||||||
// TODO: Replace with code to get secret from env
|
// 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(),
|
&Validation::default(),
|
||||||
)
|
)
|
||||||
.map_err(|_| {
|
.map_err(|_| {
|
||||||
|
|||||||
Reference in New Issue
Block a user