private function getCustomerForProfile($provider, UserProfile $profile)
    {
        /** @var Customer $customer */
        $customer = $this->customerFactory->create();
        $customer->setWebsiteId($this->getCurrentWebsiteId());
        $customer->loadByEmail($profile->emailVerified);
        if (!$customer->getId()) {
            $customer->setData('email', $profile->emailVerified);
            $customer->addData($this->getCustomerData($profile));
            $this->handleProviderQuirks($provider, $customer);
            $this->customerResource->save($customer);
        }
        return $customer;
    }
private function getCustomerForProfile($provider, UserProfile $profile)
    {
        /** @var Customer $customer */
        $customer = $this->customerFactory->create();
        $customer->setWebsiteId($this->getCurrentWebsiteId());
        $customer->loadByEmail($profile->emailVerified);
        if (!$customer->getId()) {
            $customer->setData('email', $profile->emailVerified);
            $customer->addData($this->getCustomerData($profile));
            $this->handleProviderQuirks($provider, $customer);
            $this->customerResource->save($customer);
        }
        return $customer;
    }
private function getCustomerForProfile ( $ provider , UserProfile $ profile ) { /** @var Customer $customer */ $ customer = $ this -> customerFactory -> create ( ) ; $ customer -> setWebsiteId ( $ this -> getCurrentWebsiteId ( ) ) ; $ customer -> loadByEmail ( $ profile -> emailVerified ) ; if ( ! $ customer -> getId ( ) ) { $ customer -> setData ( 'email' , $ profile -> emailVerified ) ; $ customer -> addData ( $ this -> getCustomerData ( $ profile ) ) ; $ this -> handleProviderQuirks ( $ provider , $ customer ) ; $ this -> customerResource -> save ( $ customer ) ; } return $ customer ; }
Loads or creates a customer for a hybridauth profile.

@param string $provider
@param UserProfile $profile
@return Customer
@throws LocalizedException
@throws \Exception
Loads or creates a customer for a hybridauth profile .