Because $token refs an object, this statement will always be true. Therefore an empty oauth_token param will be added to each request, wich will break Bitbucket authorization process.

To fix this, we need to check if token key is empty and ignore it.
This commit is contained in:
Alexandru G 2013-06-05 13:37:45 +03:00 committed by Jacob Kiers
parent 6677c1da7d
commit 087cb1278f

View File

@ -157,7 +157,7 @@ class Request implements RequestInterface
'oauth_nonce' => Request::generateNonce(), 'oauth_nonce' => Request::generateNonce(),
'oauth_timestamp' => Request::generateTimestamp(), 'oauth_timestamp' => Request::generateTimestamp(),
'oauth_consumer_key' => $consumer->getKey()); 'oauth_consumer_key' => $consumer->getKey());
if ($token) { if ($token->getKey()) {
$defaults['oauth_token'] = $token->getKey(); $defaults['oauth_token'] = $token->getKey();
} }