Skip to content
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

Closed
GiampieroMarrosu opened this issue May 8, 2019 · 3 comments · Fixed by #1706
Closed

Incorrect Case readme #1701

GiampieroMarrosu opened this issue May 8, 2019 · 3 comments · Fixed by #1706
Assignees
Labels
needs more info This issue needs more information from the customer to proceed. type: docs Improvement to the documentation for an API.

Comments

@GiampieroMarrosu
Copy link

GiampieroMarrosu commented May 8, 2019

Here
https://github.com/googleapis/google-api-nodejs-client#oauth2-client

oauth2Client has different case in different position

@bcoe
Copy link
Contributor

bcoe commented May 9, 2019

👋 hey @Giampy86 are you talking about the casing of the heading:

# OAuth2 client

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?

@bcoe bcoe added needs more info This issue needs more information from the customer to proceed. type: docs Improvement to the documentation for an API. labels May 9, 2019
@GiampieroMarrosu
Copy link
Author

GiampieroMarrosu commented May 9, 2019

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:
Retrieve access token

// 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);`

and
Handling refresh 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

@bcoe
Copy link
Contributor

bcoe commented May 9, 2019

@GiampieroMarrosu good catch! Do you feel like submitting a fix, alternatively I can keep this open and we can try to address soon.

CodeByRahulSaini added a commit to CodeByRahulSaini/google-api-nodejs-client that referenced this issue May 10, 2019
JustinBeckwith pushed a commit that referenced this issue May 10, 2019
@JustinBeckwith JustinBeckwith self-assigned this Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info This issue needs more information from the customer to proceed. type: docs Improvement to the documentation for an API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants