-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Difference between authToken and refreshToken #136
Comments
@hatsumatsu The auth token is only valid for 5 mins, so after those 5 minutes you would need to fetch a new authtoken with your refreshtoken. Refreshtokens should/can only only be used to fetch new authtokens. |
@martinowren Thank you for clarifying.
In my tests though refteshTokens do allow fetching private data like draft posts without obtaining a new authToken (which is handy). The official example if how to use wordpress with nextjs uses this approach, too. |
@martinowren Looking at this question and #144 again I assume the Is this how the plugin works? |
Looking through the docs I couldn't find an explanation of how authToken and refreshToken differ except in their default lifespan (5min vs. 1 year?). Both seem to enable querying private data like draft posts but are they completely interchangeable? When should we prefer one over the other?
PS: Thank you for providing this powerful toolset to the WP community.
The text was updated successfully, but these errors were encountered: