Url replace after loginWithRedirect


I saw similar thems, but not found solution. also checked SDK docs.
I made simple SPA with Vue.
Login with loginWithRedirect() method.
SPA located in subdirectory https://example.com/auth0-demo

all works fine. After login redirects back to /auth0-demo?code=...&status=... and then url replaced to /, but i want to keep same path /auth0-demo i tried:

  • appStatus.target - in loginWithRedirect()
  • openUrl() - in loginWithRedirect() and in createAuth0()
    but nothing works. how to keep same path /auth0-demo?

Thank you for advice!

auth0-react works like a charm

Hey there!

Wanted to confirm, did you solve it with auth0-react SDK?


Yes, with auth0-react all works as expected - path remains /auth0-demo after redirect.
And of course auth0-spa-js works fine - there redirect is under full control.

Bug in ./src/plugin.ts private method __checkSession :

const target = appState?.target ?? '/';
window.history.replaceState({}, '', '/');

target should be used in replaceState

1 Like

Perfect! Glad to hear that!