You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have implemented a POC in SvelteKit using Auth0 OAuth provider to auto-login user as soon as they hit the URL. I have used signin REST API for this purpose.
Accordingly user can logout by clicking logout button that triggers await signOut({ redirect: false, callbackUrl: '${window.location.origin}/app/logout' });
Problem
As soon as user hits localhost:4000 -> they are auto logged-in and redirect to home page (/app)
Now they click logout button and are redirected to localhost:4000/app/logout i.e., the URL that was specified within callback option of signOut function.
Now when user hits localhost:4000 again -> ideally they should land on home page /app, but that's not the case -> they are again redirected to /app/logout. THIS IS THE ISSUE. Post auto-login after successful logout, user is redirected to callback-url that is provided in signOut option.
When the user hits localhost:4000 again, this time they will land on home page /app.
Note
In corporate application, we use different OAuth provider and I am facing same issue there as well. So this bug is not limited to any single OAuth provider.
How to reproduce
Open the browser and hit http://localhost:4000
Verify you're successfully logged in and on home page (/app)
Click on Logout button (on header)
For a fraction of second, you'll be redirect to /app/logout and post that on https://authjs.dev/
Now follow step 1 and go back to localhost:4000
After successful login, you're redirected to -> /app/logout -> https://authjs.dev/
Hit localhost:4000 again -> this time you'll be on correct page i.e. /app
Expected behavior
There should not be any unexpected navigation. Once the user logs-out and logs-in back, they should stay on home page and should not be redirected to logout page (or callbackUrl that was provided in signOut option.)
The text was updated successfully, but these errors were encountered:
Environment
Reproduction URL
Code: https://github.com/aakash14goplani/SvelteKit-Auth0-NextAuth
Demo: https://svelte-kit-auth0-next-auth.vercel.app/
Describe the issue
Context
signin
REST API for this purpose.await signOut({ redirect: false, callbackUrl: '${window.location.origin}/app/logout' });
Problem
localhost:4000
-> they are auto logged-in and redirect to home page (/app
)localhost:4000/app/logout
i.e., the URL that was specified within callback option ofsignOut
function.localhost:4000
again -> ideally they should land on home page/app
, but that's not the case -> they are again redirected to/app/logout
. THIS IS THE ISSUE. Post auto-login after successful logout, user is redirected to callback-url that is provided insignOut
option.localhost:4000
again, this time they will land on home page/app
.Note
In corporate application, we use different OAuth provider and I am facing same issue there as well. So this bug is not limited to any single OAuth provider.
How to reproduce
http://localhost:4000
/app
)/app/logout
and post that onhttps://authjs.dev/
localhost:4000
/app/logout
->https://authjs.dev/
localhost:4000
again -> this time you'll be on correct page i.e./app
Expected behavior
There should not be any unexpected navigation. Once the user logs-out and logs-in back, they should stay on home page and should not be redirected to logout page (or callbackUrl that was provided in
signOut
option.)The text was updated successfully, but these errors were encountered: