X Tutup
Skip to content

Check token has expires_in attribute#2218

Merged
bshaffer merged 4 commits intogoogleapis:mainfrom
dmitryuk:access-token-validate
Apr 6, 2022
Merged

Check token has expires_in attribute#2218
bshaffer merged 4 commits intogoogleapis:mainfrom
dmitryuk:access-token-validate

Conversation

@dmitryuk
Copy link
Contributor

Related #2217

@dmitryuk dmitryuk requested a review from a team February 24, 2022 04:46
@google-cla
Copy link

google-cla bot commented Feb 24, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

For more information, open the CLA check for this pull request.

@dmitryuk
Copy link
Contributor Author

CLA signed

@bshaffer
Copy link
Contributor

bshaffer commented Apr 5, 2022

This check may affect code paths that were previously unaffected by this error, therefore causing a backwards-compatibility issue. I suggest adding an isset before line 574 instead:

if (!isset($this->token['expires_in'])) {
    // if the token does not have an "expires_in", then it's considered expired
    return true;
}

return ($created + ($this->token['expires_in'] - 30)) < time();

@dmitryuk
Copy link
Contributor Author

dmitryuk commented Apr 6, 2022

@bshaffer, agree with you. Added new changes to PR

@bshaffer bshaffer enabled auto-merge (squash) April 6, 2022 14:53
@bshaffer bshaffer merged commit e96471b into googleapis:main Apr 6, 2022
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

Successfully merging this pull request may close these issues.

2 participants

X Tutup