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

v4: Allow wildcards in returnTo Allowed Logout URLs again #1883

Open
6 tasks done
larsEichler opened this issue Feb 5, 2025 · 1 comment
Open
6 tasks done

v4: Allow wildcards in returnTo Allowed Logout URLs again #1883

larsEichler opened this issue Feb 5, 2025 · 1 comment

Comments

@larsEichler
Copy link

larsEichler commented Feb 5, 2025

Checklist

Description

In v4 the returnTo param seems to be way more strict than it was in v3. In v3 you were able to configure wildcards http://localhost:3000/*/about, with v4 it seems you need to explicitly set URLs in full.

This is creating an issue for us, as our app has multiple languages, multiple environments (development, staging, production) AND we pass messages with the query parameters of the returnTo-URL.

Is it possible to allow wildcards in the Allowed Logout URLs again with v4? Also, you were not required to pass the full URL with host and protocol before, like href="/auth/logout?returnTo=/en/about?message=forced_logout". Now the full URL is required and has to be exactly like in the Allowed Logout URLs setting. Can't we go back to the old implementation?

Reproduction

It CAN NOT be reproduced with the example app, as the example app is not yet updated to v4. Here is an example-repo: https://github.com/larsEichler/nextjs-auth0-returnto-issue

  1. Clone and set up repo
  2. In auth0 set up a Regular Web App with NextJS as framework
  3. Set Allowed Callback URLs: http://localhost:3000/auth/callback
  4. Set Allowed Logout URLs: http://localhost:3000/*/about
  5. Run the application
  6. Register a new user/Login with the one you already created
  7. Click on Logout

Additional context

No response

nextjs-auth0 version

v4.0.0

Next.js version

v15.1.6, v14.2.23

Node.js version

v22.12.0

@DawnMD
Copy link

DawnMD commented Feb 10, 2025

Facing the same issue, as our website is like an e-commerce where user can apply coupon code. While auth is not an absolute mandatory and also coupon code can change drastically, so putting up the exact url with query params will be very much irrelevant.

Other way is to always reset the url and send them back to home page but that will be bad for ux as all the query params will be lost and user have to start again.

This seems not to be an issue with v3

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

No branches or pull requests

2 participants