mirror of
https://github.com/TECHNOFAB11/jwt-authorizer.git
synced 2025-12-11 23:50:07 +01:00
fix: JwtClaims error message missplaced
This commit is contained in:
parent
215bc173c6
commit
7b6f8fb4c5
1 changed files with 1 additions and 2 deletions
|
|
@ -26,11 +26,10 @@ where
|
|||
type Rejection = StatusCode;
|
||||
|
||||
async fn from_request_parts(parts: &mut Parts, _: &S) -> Result<Self, Self::Rejection> {
|
||||
tracing::error!("JwtClaims extractor must be behind a jwt-authoriser layer!");
|
||||
|
||||
if let Some(claims) = parts.extensions.get::<TokenData<T>>() {
|
||||
Ok(JwtClaims(claims.claims.clone()))
|
||||
} else {
|
||||
tracing::error!("JwtClaims extractor must be behind a jwt-authoriser layer!");
|
||||
Err(StatusCode::INTERNAL_SERVER_ERROR)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue