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

Wrong createdAt date on OAuthClient.token.getToken() response #119

Open
edyrkaj opened this issue Sep 15, 2021 · 2 comments
Open

Wrong createdAt date on OAuthClient.token.getToken() response #119

edyrkaj opened this issue Sep 15, 2021 · 2 comments

Comments

@edyrkaj
Copy link

edyrkaj commented Sep 15, 2021

Description:

Version:
"intuit-oauth": "^4.0.0",

Node
10.24

When I use existing tokens from the storage and validate the token before accessing other methods of QB
method: OAuthClient.isAccessTokenValid() returns always true.

{ token_type: 'bearer',
      access_token: xxx',
      expires_in: 3600,
      refresh_token: 'xxx',
      x_refresh_token_expires_in: 0,
      realmId: 'yy',
      id_token: '',
      createdAt: 1631695486623 }

On this response I see that createdAt timestamp is always time when I call the method OAuthClient.token.getToken()
which I think is wrong because it should be the time when token is created in order to make the validation for expired token.

OAuthClient.token.getToken() this method is broken.

@edyrkaj edyrkaj changed the title Wrong created_at date on OAuthClient.token.getToken() Wrong createdAt date on OAuthClient.token.getToken() response Sep 15, 2021
@edyrkaj edyrkaj closed this as completed Sep 15, 2021
@edyrkaj
Copy link
Author

edyrkaj commented Sep 15, 2021

Just found that token needs to set value from place where we store last time connected with QB and when token is created
https://github.com/intuit/oauth-jsclient/blob/master/src/access-token/Token.js
_checkExpiry

@edyrkaj edyrkaj reopened this Sep 15, 2021
@singhikjot
Copy link

singhikjot commented Oct 22, 2021

@edyrkaj Can you please assign this issue to me and also add a hacktoberfest tag

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

No branches or pull requests

3 participants