Skip to content
Discussion options

You must be logged in to vote

Token rotation is not currently supported built-in, but it can be done in userland.

10 minutes might be a bit aggressive but probably depends on your use case.

To work around this now, your provider will need to give back a refresh_token, and the lifetime of the access_token. With those, you can create the logic that will refetch the token when it is near being expired.

We've done this in production already.

https://next-auth.js.org/tutorials/refresh-token-rotation This should give you an idea.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by xennialex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
question Ask how to do something or how something works
2 participants
Converted from issue

This discussion was converted from issue #3266 on November 23, 2021 11:57.