JwtAuth from version 0.44 to 0.45 #311
-
Hi, In version 0.44 I have this and works fine
But when I go to 0.45 I get this error:
Modify it according to documentation and examples in this way:
but I get
I don't know how to fix this |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I added more features to jwt_auth, you can follow this example: https://github.com/salvo-rs/salvo/blob/main/examples/jwt-auth/src/main.rs use salvo::jwt_auth::{ConstDecoder, QueryFinder};
let auth_handler: JwtAuth<JwtClaims, _> = JwtAuth::new(ConstDecoder::from_secret(SECRET_KEY.as_bytes()))
.finders(vec![
// Box::new(HeaderFinder::new()),
Box::new(QueryFinder::new("jwt_token")),
// Box::new(CookieFinder::new("jwt_token")),
])
.force_passed(true); |
Beta Was this translation helpful? Give feedback.
-
I switch to:
I get this error:
|
Beta Was this translation helpful? Give feedback.
Try this: