Github provider not returning a refreshToken #4416
Unanswered
DarrenBaldwin07
asked this question in
Help
Replies: 1 comment 5 replies
-
For GitHub or any OAuth provider, the token endpoint will return While NextAuth.js does not provide refresh token rotation out of the box, you can implement it following this guide: https://next-auth.js.org/tutorials/refresh-token-rotation |
Beta Was this translation helpful? Give feedback.
5 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 💬
Not sure if this is an issue on my end -- but I referenced the Github OAuth (https://docs.github.com/en/developers/apps/building-oauth-apps/authorizing-oauth-apps) docs and found that the that NextAuth uses an endpoint that does not return a refresh_token (only an access_token). I also found that other providers (ex: Google) do return a refreshToken along with their accessToken.
Question: is this intended?
The fact that the default Account model has a refreshToken field leads me to think that the GithubProvider should not just return an access token. I need to be able to silently refresh access tokens without having to re-login with an OAuth provider each time.
Any help would be much appreciated.
How to reproduce ☕️
n/a
Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR.
Beta Was this translation helpful? Give feedback.
All reactions