Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dont redirect to authorization url if accept type is application/json. #128

Open
dniel opened this issue Sep 22, 2019 · 1 comment
Open
Assignees
Labels
enhancement New feature or request

Comments

@dniel
Copy link
Owner

dniel commented Sep 22, 2019

To stop redirecting to the login page of Auth0 when rest ajax clients does requests, check if the accept type of the request is application/json and just deny access instead of redirecting to html-page.

A ajax javascript client will not manage to do anything useful with the login page of Auth0.
Its better just to stop accepting and wait for better times.

Some helpful libraries also set x-requested-with to XMLHttpRequest to indicate that its a ajax call from a library.

@dniel dniel added the enhancement New feature or request label Sep 22, 2019
@dniel dniel self-assigned this Sep 22, 2019
@dniel
Copy link
Owner Author

dniel commented Sep 22, 2019

And as well if header x-requested-with is set to XMLHttpRequest

dniel added a commit that referenced this issue Sep 25, 2019
If one of them is set then just show 403 forbidden instead of redirect to auth0 for login.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant