mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-23 21:49:50 +05:30
Small bug fixes. Fixes #13
This commit is contained in:
parent
f102b4fb68
commit
b6ba08813d
@ -291,8 +291,8 @@ class AuthServer
|
|||||||
throw new Exception\ClientException(sprintf(self::$exceptionMessages['invalid_request'], 'redirect_uri'), 0);
|
throw new Exception\ClientException(sprintf(self::$exceptionMessages['invalid_request'], 'redirect_uri'), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->requireStateParam === true && is_null($authParams['redirect_uri'])) {
|
if ($this->requireStateParam === true && is_null($authParams['state'])) {
|
||||||
throw new Exception\ClientException(sprintf(self::$exceptionMessages['invalid_request'], 'redirect_uri'), 0);
|
throw new Exception\ClientException(sprintf(self::$exceptionMessages['invalid_request'], 'state'), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate client ID and redirect URI
|
// Validate client ID and redirect URI
|
||||||
|
@ -120,7 +120,7 @@ class Password implements GrantTypeInterface {
|
|||||||
// Check if user's username and password are correct
|
// Check if user's username and password are correct
|
||||||
$userId = call_user_func($this->getVerifyCredentialsCallback(), $authParams['username'], $authParams['password']);
|
$userId = call_user_func($this->getVerifyCredentialsCallback(), $authParams['username'], $authParams['password']);
|
||||||
|
|
||||||
if ($userId === false) {
|
if ($userId === false || $userId === null) {
|
||||||
throw new Exception\ClientException(AuthServer::getExceptionMessage('invalid_credentials'), 0);
|
throw new Exception\ClientException(AuthServer::getExceptionMessage('invalid_credentials'), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user