silex-oauth icon indicating copy to clipboard operation
silex-oauth copied to clipboard

Handle of oAuth response with error.

Open defragmentator opened this issue 8 years ago • 0 comments

To prevent: InvalidArgumentException: $user must be an instanceof UserInterface, an object im plementing a __toString method, or a primitive string. (uncaught exception) at /vendor/sy mfony/security/Core/Authentication/Token/AbstractToken.php line 94 {"exception":"[object](InvalidArgumentException%28code : 0%29: $user must be an instanceof UserInterface, an object implementing a __toString method, or a primitive string. at/vendor/symfony/security/Core/Authentication/Token/AbstractToken.php:94)"} []

Caused by oauth returned Error instead of user data like this:

array('error' => array('message' => 'Invalid OAuth access token.', 'type' => 'OAuthException', 'code' => '190', 'fbtrace_id' => 'HZmpbcgRi1l'))

defragmentator avatar Aug 07 '16 22:08 defragmentator