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!
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!