0
votes

I am storing the access_token and refresh_token generated into the database. When the access_token expires I need to refresh the access token using refresh_token. This I have achieved by following method:

oauth2Client.refreshAccessToken(function (err, tokens) {
        if (err) {
console.log("Error in refreshing token: " + err);
            return;
        }
        if (tokens) {
            console.log("tokens:- ", tokens);
        }
    });

But the issue here is that using Webstorm as an IDE it is showing that the method "refreshaccesstoken" is deprecated. Can anyone help me in this situation !

1

1 Answers

1
votes

I think you are missing any of the credentials to given. please re-examine the code. You can go through the [link]( how to use the refreshAccessToken method to generate a new accesstoken in google-api-nodejs-client). Also you can check in git