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
@odorisioe You will need to setup a specific route which uses try mode. Then in your code you'll need an assertion which checks if authenticated. When you have a request which is not authenticated, you should respond with your error payload.
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
lockbot
locked as resolved and limited conversation to collaborators
Jan 9, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
supportQuestions, discussions, and general support
Hello, I wonder how i can customize the response on two different situations:
On a normal request, if the URL requires session, I want to redirect to a /login page.
Here I can set the option "redirectTo" with "/login".
On a ajax request, I want to return a custom JSON. But If I add the "redirectTo" I get a redirect to /login
I am trying to use Hapi without a client (like angular/react) so I am looking use both options on the Hapi side.
Is there any way to do it?
Thanks for your time!
The text was updated successfully, but these errors were encountered: