Replies: 2 comments
-
Simplified example: jwt: async ({ token, user, account }) => {
console.log(token.expiresAt)
// here token.expiresAt will NEVER be equals 'hey'
if (account && user) {
return {
accessToken: user.tokens.access,
refreshToken: user.tokens.refresh,
expiresAt: Date.now() + 10 * 1000,
user
}
}
if (Date.now() < token.expiresAt) {
return token
}
token.expiresAt = 'hey'
return token
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
I am experiencing the same behavior on auth.js v5 with the auth cookie receiving a new token (with extended expiration date) for each request. Did you find the root cause of this issue ? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Question 💬
Hello all.
I'm using own CredentialsProvider with token refresh (like in tutorial):
The problem is that after refreshing token expiresAt not updating, so
refreshAccessToken
is calling every request.After all debugging I understood that token is not changing after first call of
jwt
callback. Any ideas please, what I'm doing wrong?How to reproduce ☕️
Usage in page:
Contributing 🙌🏽
No, I am afraid I cannot help regarding this
Beta Was this translation helpful? Give feedback.
All reactions