Bugfix in Server and CS Fixes.
This commit is contained in:
		| @@ -33,20 +33,20 @@ public function lookupClient($client_key); | ||||
|      * Validate a token. | ||||
|      * | ||||
|      * @param JacobKiers\OAuth\Client $client | ||||
|      * @param JacobKiers\OAuth\Token  $token | ||||
|      * @param string                 $token_type Request or access token | ||||
|      * @param string                  $token_type Request or access token | ||||
|      * @param string                  $token_key | ||||
|      * | ||||
|      * @return JacobKiers\OAuth\Token | ||||
|      */ | ||||
|     public function lookupToken(Client $client, Token $token, $token_type); | ||||
|     public function lookupToken(Client $client, $token_type, $token_key); | ||||
|  | ||||
|     /** | ||||
|      * Validate that a nonce has not been used with the same timestamp before. | ||||
|      * | ||||
|      * @param JacobKiers\OAuth\Client $client | ||||
|      * @param JacobKiers\OAuth\Token  $token | ||||
|      * @param string                 $nonce | ||||
|      * @param int                    $timestamp | ||||
|      * @param string                  $nonce | ||||
|      * @param int                     $timestamp | ||||
|      * | ||||
|      * @return boolean | ||||
|      */ | ||||
| @@ -56,7 +56,7 @@ public function lookupNonce(Client $client, Token $token, $nonce, $timestamp); | ||||
|      * Return a new token attached to this client. | ||||
|      * | ||||
|      * @param JacobKiers\OAuth\Client $client | ||||
|      * @param string                 $callback URI to store as the post-authorization callback. | ||||
|      * @param string                  $callback URI to send the post-authorisation callback to. | ||||
|      * | ||||
|      * @return JacobKiers\OAuth\Token | ||||
|      */ | ||||
| @@ -70,7 +70,7 @@ public function newRequestToken(Client $client, $callback = null); | ||||
|      * | ||||
|      * @param JacobKiers\OAuth\Client $client | ||||
|      * @param JacobKiers\OAuth\Token  $token | ||||
|      * @param string                 $verifier | ||||
|      * @param string                  $verifier | ||||
|      * | ||||
|      * @return JacobKiers\OAuth\Token | ||||
|      */ | ||||
|   | ||||
| @@ -121,7 +121,7 @@ public function fetchAccessToken(RequestInterface &$request) | ||||
|         // Rev A change | ||||
|         $verifier = $request->getOAuthVerifier(); | ||||
|  | ||||
|         return $this->data_store->newAccessToken($token, $client, $verifier); | ||||
|         return $this->data_store->newAccessToken($client, $token, $verifier); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -231,9 +231,9 @@ private function getClient(RequestInterface $request) | ||||
|      */ | ||||
|     private function getToken(RequestInterface $request, Client $client, $token_type = 'access') | ||||
|     { | ||||
|         $token_field = $request instanceof RequestInterface ? $request->getOAuthToken() : null; | ||||
|         $token_key = $request instanceof RequestInterface ? $request->getOAuthToken() : null; | ||||
|  | ||||
|         $token = $this->data_store->lookupToken($client, $token_type, $token_field); | ||||
|         $token = $this->data_store->lookupToken($client, $token_type, $token_key); | ||||
|         if (!$token) { | ||||
|             throw new OAuthException("Invalid $token_type token: $token_field"); | ||||
|         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jacob Kiers
					Jacob Kiers