Skip to content

Authorization middleware #96

Answered by scottoffen
Jhfelectric asked this question in Q&A
Discussion options

You must be logged in to vote

There are two places you can hook into to make this check. You can do it either when the request is received by the server, or prior to the request being routed. Handlers for both of these hooks are executed asynchronously.

  • server.OnRequestAsync handlers are delegates of type RequestReceivedAsyncEventHandler, and run when the request has been received by the server. This is useful when you want code to run independent of whether the request is routed. For example, requests for static files served from content folders will not be routed.

  • router.BeforeRoutingAsync handlers are delegates of type RoutingAsyncEventHandler, and run just before any routes are executed (and there is a corresp…

Replies: 2 comments 2 replies

Comment options

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

Comment options

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

Answer selected by Jhfelectric
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