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 would like to inform the user after they are redirected to the sign-in page if their session has expired or has been deleted, assuming that the sign-out wasn't initiated by the user.
When using withAuth middleware and the token is not available, the current behavior (next-auth v4.22.1) is to redirect the user to pages.signIn page. It seems that no error is added as a query parameter ( https://next-auth.js.org/configuration/nextjs#pages)
The wrap middleware also doesn't help, because it's not invoked if the token is not available.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I would like to inform the user after they are redirected to the sign-in page if their session has expired or has been deleted, assuming that the sign-out wasn't initiated by the user.
When using
withAuthmiddleware and the token is not available, the current behavior (next-auth v4.22.1) is to redirect the user topages.signInpage. It seems that no error is added as a query parameter (https://next-auth.js.org/configuration/nextjs#pages)
The wrap middleware also doesn't help, because it's not invoked if the token is not available.
Now I use the following approach:
Is there a better way to detect a missing session?
All reactions