Fix exception usage

This commit is contained in:
Alex Bilbie 2016-03-17 11:18:59 +00:00
parent c3c49c83f9
commit bd12c8b1a9
2 changed files with 3 additions and 3 deletions

View File

@ -72,12 +72,12 @@ class PasswordGrant extends AbstractGrant
{
$username = $this->getRequestParameter('username', $request);
if (is_null($username)) {
throw OAuthServerException::invalidRequest('username', null, '`%s` parameter is missing');
throw OAuthServerException::invalidRequest('username', '`%s` parameter is missing');
}
$password = $this->getRequestParameter('password', $request);
if (is_null($password)) {
throw OAuthServerException::invalidRequest('password', null, '`%s` parameter is missing');
throw OAuthServerException::invalidRequest('password', '`%s` parameter is missing');
}
$user = $this->userRepository->getUserEntityByUserCredentials($username, $password);

View File

@ -101,7 +101,7 @@ class RefreshTokenGrant extends AbstractGrant
{
$encryptedRefreshToken = $this->getRequestParameter('refresh_token', $request);
if (is_null($encryptedRefreshToken)) {
throw OAuthServerException::invalidRequest('refresh_token', null, '`%s` parameter is missing');
throw OAuthServerException::invalidRequest('refresh_token', '`%s` parameter is missing');
}
// Validate refresh token