Skip to content

Custom response on normal request and AJAX #144

@odorisioe

Description

@odorisioe

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!

Metadata

Metadata

Assignees

Labels

supportQuestions, discussions, and general support

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions