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

findAuthorization() protected method

Checks if a valid authorization exists for a given user
protected findAuthorization ( HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response ) : Authorization | null
$response HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface Response of the ResourceOwner
return Elcodi\Store\ConnectBundle\Entity\Authorization | null
    protected function findAuthorization(UserResponseInterface $response)
    {
        $resourceOwnerName = $response->getResourceOwner()->getName();
        $username = $response->getUsername();
        return $this->authorizationDirector->findOneBy(['resourceOwnerName' => $resourceOwnerName, 'username' => $username]);
    }