Skip to content

Commit

Permalink
Merge pull request #212 from imtiazmahbub/patch-2
Browse files Browse the repository at this point in the history
Fixed Issue: Undefined index: emails
  • Loading branch information
amnah authored Nov 11, 2019
2 parents 4f46064 + 31509de commit 317290a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ protected function setInfoGoogle($attributes)
$user = $this->module->model("User");
$profile = $this->module->model("Profile");

$user->email = $attributes["emails"][0]["value"];
$profile->full_name = "{$attributes["name"]["givenName"]} {$attributes["name"]["familyName"]}";
$user->email = isset($attributes["email"]) ? $attributes["email"] : $attributes["emails"][0]["value"];
$profile->full_name = isset($attributes["name"]["givenName"]) ? "{$attributes["name"]["givenName"]} {$attributes["name"]["familyName"]}" : $attributes["name"];

return [$user, $profile];
}
Expand Down

0 comments on commit 317290a

Please sign in to comment.