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

Google_Client::verifyIdToken throws undocumented exception #1591

Closed
crtl opened this issue Feb 12, 2019 · 1 comment
Closed

Google_Client::verifyIdToken throws undocumented exception #1591

crtl opened this issue Feb 12, 2019 · 1 comment
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. type: docs Improvement to the documentation for an API.

Comments

@crtl
Copy link

crtl commented Feb 12, 2019

Environment details

  • PHP version: 7.2
  • Package Version: 2.2

Steps to reproduce

Pass an invalid non JWT Token to Google_Client::verifyIdToken.

Code example

try {
    $token = $this->googleClient->verifyIdToken("123");
} catch (\LogicException $ex) {
    throw new \Exception("Could not retrieve user information", $ex->getCode(), $ex);
}
//Uncaught exception UnexpectedValueException

It will throw a UnexpectedValueException but verifyidToken is only hinted to throw LogicException.

@crtl crtl changed the title Google_Client::verifyIdToken throws undocumented exceptions Google_Client::verifyIdToken throws undocumented exception Feb 12, 2019
@jdpedrie jdpedrie added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. type: docs Improvement to the documentation for an API. labels Feb 12, 2019
@jdpedrie
Copy link
Contributor

Thanks for the report @crtl. I've opened #1592 to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. type: docs Improvement to the documentation for an API.
Projects
None yet
Development

No branches or pull requests

3 participants