mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-15 09:47:46 +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);
|
$username = $this->getRequestParameter('username', $request);
|
||||||
if (is_null($username)) {
|
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);
|
$password = $this->getRequestParameter('password', $request);
|
||||||
if (is_null($password)) {
|
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);
|
$user = $this->userRepository->getUserEntityByUserCredentials($username, $password);
|
||||||
|
@ -101,7 +101,7 @@ class RefreshTokenGrant extends AbstractGrant
|
|||||||
{
|
{
|
||||||
$encryptedRefreshToken = $this->getRequestParameter('refresh_token', $request);
|
$encryptedRefreshToken = $this->getRequestParameter('refresh_token', $request);
|
||||||
if (is_null($encryptedRefreshToken)) {
|
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
|
// Validate refresh token
|
||||||
|
Loading…
Reference in New Issue
Block a user