From 61d1685e84df79cb566b714f0ee1cae085c2763c Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Tue, 12 Feb 2013 16:45:33 +0000 Subject: [PATCH] Minor fixes to password grant --- src/OAuth2/Grant/Password.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OAuth2/Grant/Password.php b/src/OAuth2/Grant/Password.php index b3fbaea0..b227083e 100644 --- a/src/OAuth2/Grant/Password.php +++ b/src/OAuth2/Grant/Password.php @@ -31,13 +31,13 @@ class Password implements GrantTypeInterface { $this->callback = $callback; } - protected function getVerifyCredentialsCallback($username, $password) + protected function getVerifyCredentialsCallback() { if (is_null($this->callback) || ! is_callable($this->callback)) { throw new Exception\InvalidGrantTypeException('Null or non-callable callback set'); } - return call_user_func($this->callback, $username, $password); + return $this->callback; } public function completeFlow($inputParams = null, $authParams = array()) @@ -88,7 +88,7 @@ class Password implements GrantTypeInterface { } // Check if user's username and password are correct - $userId = call_user_func($this->getVerifyCredentialsCallback, $params['username'], $params['password']); + $userId = call_user_func($this->getVerifyCredentialsCallback(), $authParams['username'], $authParams['password']); if ($userId === false) { throw new Exception\ClientException(AuthServer::getExceptionMessage('invalid_credentials'), 0);