mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-01 16:33:07 +05:30
Fix exception usage
This commit is contained in:
parent
c3c49c83f9
commit
bd12c8b1a9
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user