refactor: JwtAuthorizer::IntoLayer -> Authorizer::IntoLayer

- better error management (avoids composite errors when transforming multiple builder into layer)
This commit is contained in:
cduvray 2023-08-14 11:26:49 +02:00
parent 3d5367da88
commit e815d35a55
9 changed files with 140 additions and 117 deletions

View file

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