You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a resource is not found, we're currently calling the policy with nil for the resource value. This means that a lot of times, the policies will have a function branch pattern matching on nil and calling a FallbackController or specific handler.
We should add that as an alternative, similar to the current unauthorised handler.
Since both the new handler and the unauthorised one are plugs, we should also update the README with an example using a MyAppWeb.FallbackController as the handler
The text was updated successfully, but these errors were encountered:
Agree, but I don't think we should care about a fallback controller at all.
If people want to reach a fallback controller, the way to do that is to return an error tuple. So we can allow the option of doing that when the resource is nil, but I'd say it's up to the user to catch that on the fallback controller
The fallback controller was just an example for the README. A custom unauthorized handler that would defer errors to the fallback controller, to keep all the error handling logic in the same module (I've found myself doing this).
If a resource is not found, we're currently calling the policy with
nil
for the resource value. This means that a lot of times, the policies will have a function branch pattern matching onnil
and calling aFallbackController
or specific handler.We should add that as an alternative, similar to the current unauthorised handler.
Since both the new handler and the unauthorised one are plugs, we should also update the README with an example using a
MyAppWeb.FallbackController
as the handlerThe text was updated successfully, but these errors were encountered: