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

Check token has expires_in attribute #2218

Merged
merged 4 commits into from
Apr 6, 2022

Conversation

dmitryuk
Copy link
Contributor

Related #2217

@dmitryuk dmitryuk requested a review from a team as a code owner 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