cpjk / canary

:hatching_chick: Elixir authorization and resource-loading library for Plug applications.
MIT License
474 stars 51 forks source link

Do not run both handlers on load_and_authorize if conn was halted #75

Closed novaugust closed 5 years ago

novaugust commented 6 years ago

While your own readme uses halt/1 as the last function called in an error helper example, calling halt in the helpers will not properly stop the calling of both error helpers in the case of load_and_authorize_resource/2 because it's only checking for sent connections.

Having it check if the conn has been halted after handle_unauthorized/2 makes things behave in a more intuitively Pluggy way.