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

findUser() protected method

Find the user related to the response of the resource owner
protected findUser ( HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response ) : Symfony\Component\Security\Core\User\UserInterface | null
$response HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface
return Symfony\Component\Security\Core\User\UserInterface | null
    protected function findUser(UserResponseInterface $response)
    {
        $username = $response->getEmail();
        try {
            return $this->userProvider->loadUserByUsername($username);
        } catch (UsernameNotFoundException $e) {
            return null;
        }
    }