23 lines
713 B
PHP
23 lines
713 B
PHP
<?php
|
|
|
|
namespace KupShop\UserOauthBundle\ResourceOwner;
|
|
|
|
use HWI\Bundle\OAuthBundle\OAuth\ResourceOwner\GoogleResourceOwner;
|
|
use HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface;
|
|
|
|
class CustomGoogleResourceOwner extends CustomResourceOwner
|
|
{
|
|
public function createResourceOwner($httpClient, $httpUtils, $options, $name, $storage)
|
|
{
|
|
return new GoogleResourceOwner($httpClient, $httpUtils, $options, $name, $storage);
|
|
}
|
|
|
|
public function updateUserData(\User $user, UserResponseInterface $response)
|
|
{
|
|
$profilePicture = $response->getProfilePicture();
|
|
if ($profilePicture) {
|
|
$user->setCustomData('profilePicture', $profilePicture);
|
|
}
|
|
}
|
|
}
|