refactor: JwtAuthorizer creation simplification

This commit is contained in:
cduvray 2023-01-23 23:36:29 +01:00
parent 9101f91ad8
commit 2c0266b4f8
5 changed files with 40 additions and 38 deletions

View file

@ -28,8 +28,8 @@ async fn main() {
// First let's create an authorizer builder from a JWKS Endpoint
// User is a struct deserializable from JWT claims representing the authorized user
let jwt_auth: JwtAuthorizer<User> = JwtAuthorizer::new()
.from_jwks_url("http://localhost:3000/oidc/jwks")
let jwt_auth: JwtAuthorizer<User> = JwtAuthorizer::
from_jwks_url("http://localhost:3000/oidc/jwks")
.with_check(claim_checker);
let oidc = Router::new()