Bugfix in Server and CS Fixes.

This commit is contained in:
Jacob Kiers 2013-02-11 09:30:45 +00:00
parent 73c99e3652
commit 4e6cc6c811
2 changed files with 10 additions and 10 deletions

View File

@ -33,20 +33,20 @@ interface DataStoreInterface
* 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 @@ interface DataStoreInterface
* 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 @@ interface DataStoreInterface
*
* @param JacobKiers\OAuth\Client $client
* @param JacobKiers\OAuth\Token $token
* @param string $verifier
* @param string $verifier
*
* @return JacobKiers\OAuth\Token
*/

View File

@ -121,7 +121,7 @@ class Server
// 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 @@ class Server
*/
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");
}