Skip to content

Commit

Permalink
fix: high level auth/token changes (#1327)
Browse files Browse the repository at this point in the history
  • Loading branch information
atymic authored Jan 28, 2025
1 parent 98d30fb commit 09b8a55
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/GoHighLevel/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ protected function getUserByToken($token)
return null;
}

$response = $this->getHttpClient()->get('https://services.leadconnectorhq.com/users/' . $userId);
$response = $this->getHttpClient()->get('https://services.leadconnectorhq.com/users/' . $userId, [
'headers' => [
'Authorization' => 'Bearer ' . $token,
'Version' => '2021-07-28'
],
]);

return json_decode((string) $response->getBody(), true);
}
Expand All @@ -46,6 +51,8 @@ protected function getUserByToken($token)
*/
protected function mapUserToObject(array $user)
{
$user = array_merge($user, Arr::only($this->credentialsResponseBody, ['locationId', 'companyId', 'approvedLocations', 'planId', 'userType']));

return (new User)->setRaw($user)->map([
'name' => Arr::get($user, 'name'),
'email' => Arr::get($user, 'email'),
Expand Down

0 comments on commit 09b8a55

Please sign in to comment.