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

Improve createToken/refresh usage examples #182

Open
caub opened this issue Nov 29, 2024 · 2 comments
Open

Improve createToken/refresh usage examples #182

caub opened this issue Nov 29, 2024 · 2 comments

Comments

@caub
Copy link
Contributor

caub commented Nov 29, 2024

In README code examples show:

const authResponse = await oauthClient.createToken(..); // or .refresh() or .refreshUsingToken(..)
console.log('Token is', authResponse.json)

Instead it should be:

await oauthClient.createToken(..); // or .refresh() or .refreshUsingToken(..)
console.log('Token is', oauthToken.token.getToken())

Reason is in 1st case createdAt is missing, and this is a big issue if you save that json without it

btw I think you should rather save only 1 field: expireAt field rather than 2: createdAt + expire_in

@caub caub changed the title Improve usage example, Improve createToken/refresh usage examples Nov 29, 2024
@rajeshgupta723
Copy link
Collaborator

Hi @caub , please help me find out where do you see this i.e. in which README file? I'll check and get this corrected. Thanks!

@caub
Copy link
Contributor Author

caub commented Nov 29, 2024

https://github.com/intuit/oauth-jsclient/blob/master/README.md?plain=1#L166
https://github.com/intuit/oauth-jsclient/blob/master/README.md?plain=1#L195
https://github.com/intuit/oauth-jsclient/blob/master/README.md?plain=1#L218
https://github.com/intuit/oauth-jsclient/blob/master/README.md?plain=1#L235

so maybe changing authResponse.json to oauthClient.token.getToken() or adding a note that it's recommended to save oauthClient.token.getToken()

For revoke not sure it's needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants