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

Added destination fallback and conflict removal. #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bjcooper
Copy link

@bjcooper bjcooper commented Apr 2, 2022

Changes

It's common for authentication-related modules to send the user to the login page with a destination parameter set, so they can be redirected back to what they were trying to do prior to being prompted to log in. The Require Login module is a good example.

This redirect is performed by Drupal core. When the Auth0 Drupal module is set to redirect to the Auth0 hosted Universal Login Page for authentication, these two redirects can clash and the core redirect highjacks the Auth0 Drupal redirect.

For example, if the user visits /user/login?destination=/, Auth0 Drupal will catch that request (via the auth0.login route) and attempt to redirect the user to Auth0 Universal Login. However, Drupal core will see the destination parameter and redirect the user to /. In my testing, the Drupal core redirect happens last and "wins" and the user is never sent over to Auth0.

This PR checks if the clashing destination parameter is set during the login request handling. If it is set, it gets unset and the module uses it as a fallback for the returnTo value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant