next-auth icon indicating copy to clipboard operation
next-auth copied to clipboard

Need discussion about the "refresh_token_expires_in" field.

Open SH5H opened this issue 1 year ago • 2 comments

What is the improvement or update you wish to see?

Since "github" is not the only one that supports this field, it would be good to mention in the documentation which providers support this field and provide a workaround.

Is there any context that might help us understand?

I found that one of built-in providers, kakao, supports the "refresh_token_expires_in" field, so we did some additional work accordingly.

Does the docs page already exist? Please link to it.

No response

SH5H avatar Apr 03 '24 18:04 SH5H

What would you like to use this field for exactly? We don't document every additional field that each provider supports / returns, so I don't think that makes sense, but maybe we can come up with a more spec-compliant / supported way to do what you're trying to do :thinking:

ndom91 avatar Apr 12 '24 12:04 ndom91

By default, this field throws an error when used with the Prisma adapter. Personally, I'd like to see a small mention on the Prisma adapter page about the error and workaround when using a provider that supports this field.

SH5H avatar Apr 15 '24 02:04 SH5H

Hi, I will close this issue, because as of v5 and other Auth.js libraries, refresh_token_expires_in won't be part of the default Account. There is no intention of backporting this feature to NextAuth.js v4.

See: https://github.com/nextauthjs/next-auth/blob/862a505782588a0760721eafb6a3bb905f3e383f/packages/core/src/lib/utils/providers.ts#L114-L124

balazsorban44 avatar Aug 08 '24 18:08 balazsorban44