From 81b871da8542d88273a034b70daaab4ac580863d Mon Sep 17 00:00:00 2001 From: Derek MacDonald Date: Sat, 9 Feb 2019 18:47:26 -0500 Subject: [PATCH] Handle Google responses excluding 'name' It's possible for Google's API response to exclude the 'name' key in its JSON payload. --- src/Two/GoogleProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Two/GoogleProvider.php b/src/Two/GoogleProvider.php index 9d764f43..fc08a998 100644 --- a/src/Two/GoogleProvider.php +++ b/src/Two/GoogleProvider.php @@ -81,7 +81,7 @@ protected function mapUserToObject(array $user) return (new User)->setRaw($user)->map([ 'id' => $user['id'], 'nickname' => Arr::get($user, 'nickname'), - 'name' => $user['name'], + 'name' => Arr::get($user, 'name'), 'email' => Arr::get($user, 'email'), 'avatar' => $avatarUrl, 'avatar_original' => preg_replace('/\?sz=([0-9]+)/', '', $avatarUrl),