From 7b6f8fb4c5ff820d1caa96be736d050b003a6cac Mon Sep 17 00:00:00 2001 From: cduvray Date: Tue, 24 Jan 2023 07:31:50 +0100 Subject: [PATCH] fix: JwtClaims error message missplaced --- jwt-authorizer/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jwt-authorizer/src/lib.rs b/jwt-authorizer/src/lib.rs index a9a87c2..637d078 100644 --- a/jwt-authorizer/src/lib.rs +++ b/jwt-authorizer/src/lib.rs @@ -26,11 +26,10 @@ where type Rejection = StatusCode; async fn from_request_parts(parts: &mut Parts, _: &S) -> Result { - tracing::error!("JwtClaims extractor must be behind a jwt-authoriser layer!"); - if let Some(claims) = parts.extensions.get::>() { Ok(JwtClaims(claims.claims.clone())) } else { + tracing::error!("JwtClaims extractor must be behind a jwt-authoriser layer!"); Err(StatusCode::INTERNAL_SERVER_ERROR) } }