Skip to content

Async Style Validation Question #405

Answered by jplatte
kulak asked this question in Q&A
Sep 5, 2023 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

If you are using axum, I would recommend using middleware::from_fn instead of AsyncRequireAuthorizationLayer. The axum function is much more generic, but it really doesn't require much boilerplate to achieve the same. (check auth, on success call the inner service, on failure return an error response)

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@kulak
Comment options

Comment options

You must be logged in to vote
2 replies
@jplatte
Comment options

Answer selected by kulak
@kulak
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants