Commit 488863ed authored by john_a's avatar john_a Committed by john_a
Browse files

Issue #3060349 by john_a, matthewgsommers, Dave Reid, Alex Voloshchenko:...

Issue #3060349 by john_a, matthewgsommers, Dave Reid, Alex Voloshchenko: Incorrect return attribute for v2 auth.
parent 3642a176
......@@ -129,6 +129,7 @@ class MarketingCloudSession {
'clientId' => $clientId,
'clientSecret' => $clientSecret,
];
$accessToken = 'accessToken';
break;
case 'v2':
default:
......@@ -138,6 +139,7 @@ class MarketingCloudSession {
'client_secret' => $clientSecret,
'grant_type' => 'client_credentials',
];
$accessToken = 'access_token';
break;
}
......@@ -147,7 +149,7 @@ class MarketingCloudSession {
'form_params' => $formParams,
]);
$data = json_decode($response->getBody());
return $data->accessToken;
return $data->{$accessToken};
}
catch (RequestException $e) {
\Drupal::logger(__METHOD__)->error('Request exception, failed to fetch token: %error', ['%error' => $e->getMessage()]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment