Elcodi\Store\ConnectBundle\Services\OAuthUserProvider::loadUserByOAuthUserResponse PHP Method

loadUserByOAuthUserResponse() public method

Loads the user by a given UserResponseInterface object.
public loadUserByOAuthUserResponse ( HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response ) : Symfony\Component\Security\Core\User\UserInterface
$response HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface
return Symfony\Component\Security\Core\User\UserInterface
    public function loadUserByOAuthUserResponse(UserResponseInterface $response)
    {
        $authorization = $this->findAuthorization($response);
        if (null === $authorization) {
            $user = $this->findOrCreateUser($response);
            $authorization = $this->createAuthorization($response, $user);
        }
        $this->updateAuthorization($authorization, $response);
        $this->save($authorization);
        return $authorization->getUser();
    }