Access token expiration not updated after the first refresh when using custom API #12265
Unanswered
TheoGrassien
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In my Next.js project, where I am using auth.js with the credentials provider and generating access and refresh tokens with my custom API, I am encountering the following issue:
After the first access token expires, the refresh process works as expected. However, after each subsequent API call, the refresh function is triggered again. This is happening because the token.accessExpire is never updated, so it always passes the check if (Date.now() > token.accessExpire).
When I log the new accessExpire, it correctly shows a new expiration date, but for some reason, the token isn't being updated properly.
Here is my code :
The issue seems to be that token.accessExpire is not updating as expected. Any guidance on how to fix this or if I'm missing something in my flow would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions