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
Does access token Expires #517
Comments
Yes, that should be the case. From
If the OAuth2 client discovers that the access token is expired, then it should automatically refresh the token. You won't see the 401 or 403 for an expired token. @ryanseys Can confirm. |
Closing as this does not appear to be an issue. If you are convinced that this is really a bug, please feel free to re-open the issue and add more information such as:
Or, consider opening a Pull Request. Otherwise, support questions are handled on Stack Overflow. |
Having Does anyone know the way to check if the token was refreshed and get a new one? I have never found this in the docs. This stands for a common reason — I want to keep always up-to-date token in my database. Thanks! UPD The one way I found for now is the next one: let storedToken = { access_token: "...", expiry_date: 0000, ... };
oauth2Client.getAccessToken((err, access_token) => {
if (storedToken.access_token !== access_token) {
Object.assign(storedToken, oauth2Client.credentials || {});
}
// next steps go here
}) And there is no other way to access |
I also face the same issue. I was originally going call Is the method that @ZitRos posted the elegant solution or has someone discovered a better way? |
I'm using the API (v1) in the following way:
never got the 401 or 403 response .
currently i see the behavior that access token may be automatically refreshes.
The text was updated successfully, but these errors were encountered: