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
If you click log out right after logging in it will not work.
When checking the network in devtools, the call being made is to the login api
If we log inside auth.config.ts we can see that the redirect pathname is still /login until the page is refreshed, or user sends a message (which will cause a re-render). Then the logout will work fine and pathname will be /
Commenting out this code seems to fix it, but I don't have the time to verify.
// if (isLoggedIn) {
// if (isOnLoginPage || isOnSignupPage) {
// return Response.redirect(new URL('/', nextUrl))
// }
// }
I will try find the time to fix it properly, but if anyone gets to it first, even better. Should be a quick fix.
The text was updated successfully, but these errors were encountered:
The root cause is Response.redirect(new URL('/', nextUrl)) is a 302 redirection, makes Post method not working correctly.
Traditionally a 302 was used for a temporary redirect, and a 301 for a permanent redirect, but many browsers changed the request method of the redirect to GET, regardless of the original method.
If you click log out right after logging in it will not work.
When checking the network in devtools, the call being made is to the login api
![image](https://private-user-images.githubusercontent.com/25455658/319265597-9188e8e9-33eb-4bc3-9d78-d4e927ea1091.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ4Nzc5MDAsIm5iZiI6MTcyNDg3NzYwMCwicGF0aCI6Ii8yNTQ1NTY1OC8zMTkyNjU1OTctOTE4OGU4ZTktMzNlYi00YmMzLTlkNzgtZDRlOTI3ZWExMDkxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI4VDIwNDAwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM2MDMyNDQyNzQ2ZGYxYzk4OWViYmIyNGJkZWJjOTNlOGM5NmZjNDMwZDRiZjY2NTNiN2QxZmM0MThmNjYxYTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.k1VWYthMxELLEhD_El_arLdkgzX5hMEivKUNjTaWxr0)
If we log inside
auth.config.ts
we can see that the redirect pathname is still/login
until the page is refreshed, or user sends a message (which will cause a re-render). Then the logout will work fine and pathname will be/
Commenting out this code seems to fix it, but I don't have the time to verify.
I will try find the time to fix it properly, but if anyone gets to it first, even better. Should be a quick fix.
The text was updated successfully, but these errors were encountered: