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
Hello, I got two questions, I use NextAuth with credentials provider and I got custom backend that returns JWT token on login, and refreshToken. So everything works well, but I found out a problem with my implementation. I want to let user decide if he wanted to be "remembered" or on close card logged out. I can't find any solition across the internet or in the docs.
My second question. Sometimes during development I'm logged out for no reason from session and I had no idea, console showed me that's problem because accessToken is undefined. Ok, I did a little research and I found out it's problem with refresh token rotation while there are opened multiple cards. First one call for new token, then second one asks for the same, but refreshToken for second session has expired, so it can't get the token. Is there any solution for this? I saw an old issue (about 1 year?) somewhere, but it wasn't resolved as I remember.
How to reproduce ☕️
Create credentials provider and there it is.
Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR
questionAsk how to do something or how something works
1 participant
Converted from issue
This discussion was converted from issue #4084 on March 01, 2022 00:37.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
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.
-
Question 💬
Hello, I got two questions, I use NextAuth with credentials provider and I got custom backend that returns JWT token on login, and refreshToken. So everything works well, but I found out a problem with my implementation. I want to let user decide if he wanted to be "remembered" or on close card logged out. I can't find any solition across the internet or in the docs.
My second question. Sometimes during development I'm logged out for no reason from session and I had no idea, console showed me that's problem because accessToken is undefined. Ok, I did a little research and I found out it's problem with refresh token rotation while there are opened multiple cards. First one call for new token, then second one asks for the same, but refreshToken for second session has expired, so it can't get the token. Is there any solution for this? I saw an old issue (about 1 year?) somewhere, but it wasn't resolved as I remember.
How to reproduce ☕️
Create credentials provider and there it is.
Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR
Beta Was this translation helpful? Give feedback.
All reactions