Closed lcmgh closed 1 year ago
Hi!
I want to check my custom claim against a predefined config. Therefore I have to move a variable into the closure of `fn check.
https://docs.rs/jwt-authorizer/latest/jwt_authorizer/layer/struct.JwtAuthorizer.html#method.check
But when trying to use a variable within the check callback I am facing closures can only be coerced tofntypes if they do not capture any variables
closures can only be coerced to
types if they do not capture any variables
Hi, the PR #36, replacing a function pointer by a Fn() trait should fix you problem,
https://github.com/cduvray/jwt-authorizer/blob/20b604e2c8d7a6ac9c210dcb075a6bb89b3f3dc6/jwt-authorizer/src/builder.rs#L157-L159
Hi!
I want to check my custom claim against a predefined config. Therefore I have to move a variable into the closure of `fn check.
https://docs.rs/jwt-authorizer/latest/jwt_authorizer/layer/struct.JwtAuthorizer.html#method.check
But when trying to use a variable within the check callback I am facing
closures can only be coerced to
fntypes if they do not capture any variables