-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Incorrect Case readme #1701
Comments
👋 hey @Giampy86 are you talking about the casing of the heading:
vs., the sample code: const oauth2Client = new google.auth.OAuth2(
YOUR_CLIENT_ID,
YOUR_CLIENT_SECRET,
YOUR_REDIRECT_URL
); If this is what you had in mind, this is intentional. As, in JavaScript code (don't ask me why), you usually start the name of a variable with a lower-case letter. If this isn't what you were thinking of, perhaps you could open up a pull-request, pointing out the editing issues? |
Hy benjamin, so sorry, I was in late and I didn't give you enough information. The case mismatch that I notified is between the two portion code: // This will provide an object with the access_token and refresh_token.
// Save these somewhere safe so they can be used at a later time.
const {tokens} = await oauth2Client.getToken(code)
oauth2Client.setCredentials(tokens);` oauth2client.on('tokens', (tokens) => {
if (tokens.refresh_token) {
// store the refresh_token in my database!
console.log(tokens.refresh_token);
}
console.log(tokens.access_token);
}); as you can see in both the code above you can find oauth2client object but, the first time it is written with the C in upper case and the second time in lower case. I know that this is not a real issue but if someone(as me :D ) uses this guide to test something could worst some time looking for the wrong object |
@GiampieroMarrosu good catch! Do you feel like submitting a fix, alternatively I can keep this open and we can try to address soon. |
Here
https://github.com/googleapis/google-api-nodejs-client#oauth2-client
oauth2Client has different case in different position
The text was updated successfully, but these errors were encountered: