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) } }