Skip to content

Commit

Permalink
[OAuth2] Feature: Provider\Vk - remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
ovr committed Oct 15, 2020
1 parent fec9327 commit b6246ae
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/OAuth2/Provider/Vk.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ class Vk extends \SocialConnect\OAuth2\AbstractProvider
*/
protected $requestHttpMethod = 'GET';

/**
* Vk returns email inside AccessToken
*
* @var string|null
*/
protected $email;

public function getBaseUri()
{
return 'https://api.vk.com/';
Expand Down Expand Up @@ -77,7 +70,6 @@ public function getIdentity(AccessTokenInterface $accessToken)
'id' => 'id',
'first_name' => 'firstname',
'last_name' => 'lastname',
'email' => 'email',
'bdate' => static function ($value, User $user) {
$user->setBirthday(
new \DateTime($value)
Expand All @@ -93,7 +85,8 @@ public function getIdentity(AccessTokenInterface $accessToken)
/** @var User $user */
$user = $hydrator->hydrate(new User(), $response['response'][0]);

$user->email = $this->email ?? $accessToken->getEmail();
// Vk returns email inside AccessToken
$user->email = $accessToken->getEmail();
$user->emailVerified = true;

return $user;
Expand Down

0 comments on commit b6246ae

Please sign in to comment.