Closed mark-rushakoff closed 5 years ago
I really like the pattern.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had recent activity. Please reopen if this issue is still important to you. Thank you for your contributions.
The current pattern looks roughly like this:
It's repetitive to duplicate that call across many handlers. It would be more convenient to have a middleware, perhaps on AuthorizationService, so that I could instead write:
Maybe in addition to
RequireAuthorizationOnContext
there would be a way to indicate the token being optional too, but I think requiring it is the more common pattern./cc @goller @jademcgough @desa
(edit: code more reflective of reality)