mirror of
https://github.com/TECHNOFAB11/jwt-authorizer.git
synced 2025-12-12 08:00:07 +01:00
refactor: JwtAuthorizer::IntoLayer -> Authorizer::IntoLayer
- better error management (avoids composite errors when transforming multiple builder into layer)
This commit is contained in:
parent
3d5367da88
commit
e815d35a55
9 changed files with 140 additions and 117 deletions
|
|
@ -104,7 +104,7 @@ async fn app(jwt_auth: JwtAuthorizer<User>) -> Router {
|
|||
let protected_route: Router = Router::new()
|
||||
.route("/protected", get(protected_handler))
|
||||
.route("/protected-with-user", get(protected_with_user))
|
||||
.layer(jwt_auth.into_layer().await.unwrap());
|
||||
.layer(jwt_auth.build().await.unwrap().into_layer());
|
||||
|
||||
Router::new().merge(pub_route).merge(protected_route)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue