Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/oauth/ZohoOAuthClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function getUserEmailIdFromIAM($accessToken)
$connector->addHeadder(ZohoOAuthConstants::AUTHORIZATION, ZohoOAuthConstants::OAUTH_HEADER_PREFIX . $accessToken);
$apiResponse = $connector->get();
$jsonResponse = self::processResponse($apiResponse);
if(!array_key_exists("Email", $jsonResponse)){
if(!is_array($jsonResponse) || !array_key_exists("Email", $jsonResponse)){
throw new ZohoOAuthException("Exception while fetching UserID from access token, Make sure AAAserver.profile.Read scope is included while generating the Grant token " . $jsonResponse);
}
return $jsonResponse['Email'];
Expand All @@ -171,4 +171,4 @@ public function processResponse($apiResponse)

return $jsonResponse;
}
}
}