Added catch Runtime exception when parsing JWT string

This commit is contained in:
Jakub Filla
2016-06-22 12:38:03 +02:00
parent 8b865cc523
commit 9eccc40eb6
2 changed files with 30 additions and 0 deletions

View File

@@ -77,6 +77,9 @@ class BearerTokenValidator implements AuthorizationValidatorInterface
} catch (\InvalidArgumentException $exception) {
// JWT couldn't be parsed so return the request as is
throw OAuthServerException::accessDenied($exception->getMessage());
} catch(\RuntimeException $exception){
//JWR couldn't be parsed so return the request as is
throw OAuthServerException::accessDenied('Error while decoding to JSON');
}
}
}