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

URL is trimmed to '/' during handleRedirectCallback() invoke #424

Open
6 tasks done
IliyanRuskov opened this issue Oct 3, 2024 · 0 comments
Open
6 tasks done

URL is trimmed to '/' during handleRedirectCallback() invoke #424

IliyanRuskov opened this issue Oct 3, 2024 · 0 comments
Labels
bug This points to a verified bug in the code

Comments

@IliyanRuskov
Copy link

Checklist

  • The issue can be reproduced in the auth0-vue sample app (or N/A).
  • I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
  • I have looked into the API documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

I would like to report a corner case issue in auth0 library. When an app is served in a subdirectory like /subdir/ the app URL becomes https://<domain>/subdir/. I noticed that in __checkSession() function in plugin.ts the URL is trimmed to '/' using window.history.replaceState(...) which trims the URL to https://<domain>/. After that the router cannot route to the path specified in appState because there's no app on that URL.
I think more flexible URL handling is needed like (e.g., exposing the replaceState behavior as a configurable option).

Reproduction

  1. Setup a sample app that is not served at root but at subdirectory so the starting point of the app should become https://<domain>/<subdir>/
  2. Configure Auth0 authentication using Universal Login and set appState: {target: to.fullPath}
  3. After successful authentication the Auth0 redirects back to the app and the url is trimmed and app never goes to appState path.

Additional context

No response

auth0-vue version

2.3.3

Vue version

3.4.37

Which browsers have you tested in?

Chrome

@IliyanRuskov IliyanRuskov added the bug This points to a verified bug in the code label Oct 3, 2024
@IliyanRuskov IliyanRuskov changed the title URL is trimmed to '/' in during handleRedirectCallback() URL is trimmed to '/' during handleRedirectCallback() invoke Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This points to a verified bug in the code
Projects
None yet
Development

No branches or pull requests

1 participant