From 4ea360a0d17c3bd81b77c1a142cd86bd828f8306 Mon Sep 17 00:00:00 2001 From: trogwar Date: Fri, 1 Jul 2016 17:03:32 +0300 Subject: [PATCH] Fix bug when `id` and `email` was set to null even if they're was in user response --- src/Vkontakte.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Vkontakte.php b/src/Vkontakte.php index 5e5e963..dd59c96 100644 --- a/src/Vkontakte.php +++ b/src/Vkontakte.php @@ -165,10 +165,10 @@ class Vkontakte extends AbstractProvider } protected function createResourceOwner(array $response, AccessToken $token) { - $response = reset($response['response']); - $additional = $token->getValues(); - $response['email'] = !empty($additional['email']) ? $additional['email'] : null; - $response['id'] = !empty($additional['user_id']) ? $additional['user_id'] : null; + $response = reset($response['response']); + $additional = $token->getValues(); + if (!empty($additional['email'])) $response['email'] = $additional['email']; + if (!empty($additional['user_id'])) $response['id'] = $additional['user_id']; return new User($response, $response['id']); }