Render custom view
bartoszgorka opened this issue · comments
Bartosz Górka commented
I really like this package as Authorization module with check user scopes (in my project from JWT token).
But I have few ideas to new features in Conductor.
1. Add custom HTTP status
config :conductor, error_status: 401
2. Custom view render as body
Now body returned in an unauthorized request is empty. Is it possible to add an option in config with render function? I think about simple
def render(conn, "my_unauthorized.json") do ... end
3. Default config, dynamic config in single Endpoint
The description above is ideal for additional behavior of Conductor. You can also add new field in @authorize
param in endpoint with view: MyApp.Error.render(....)
or status: 401
-> in this single endpoint we could set different settings.
Tobiasz Małecki commented
global customization added in #3
Bartosz Górka commented
Work perfect! Thank you.