Skip to content

Commit af0bdbf

Browse files
committed
MAGETWO-31977: [Remove TODOs] Integration
- Added more information for logging request token - Moved the logging process after exception throwing
1 parent 163a7e4 commit af0bdbf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/code/Magento/Integration/Model/Oauth/Token/Provider.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,17 @@ public function validateRequestToken($requestToken, $consumer, $oauthVerifier)
127127
*/
128128
public function getAccessToken($consumer)
129129
{
130-
$token = $this->getIntegrationTokenByConsumerId($consumer->getId());
131-
$this->logger->log('Request token: ' . $token->getToken());
130+
$consumerId = $consumer->getId();
131+
$token = $this->getIntegrationTokenByConsumerId($consumerId);
132132
if (Token::TYPE_REQUEST != $token->getType()) {
133133
throw new \Magento\Framework\Oauth\Exception(
134134
'Cannot get access token because consumer token is not a request token'
135135
);
136136
}
137137
$accessToken = $token->convertToAccess();
138+
$this->logger->log(
139+
'Request token ' . $token->getToken() . ' was exchanged to obtain access token for consumer ' . $consumerId
140+
);
138141
return ['oauth_token' => $accessToken->getToken(), 'oauth_token_secret' => $accessToken->getSecret()];
139142
}
140143

0 commit comments

Comments
 (0)