-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Cannot login via social connect #1625
Copy link
Copy link
Closed
Description
Hi all, I can register using Facebook for example but when trying to log back in using Facebook connect an error occurs.
FatalErrorException: Error: Call to undefined method Sylius\Component\Core\Model\UserOAuth::getRoles() in /Users/warrenlee/Sites/sylius/vendor/hwi/oauth-bundle/HWI/Bundle/OAuthBundle/Security/Core/Authentication/Provider/OAuthProvider.php line 84I believe that the $user variable needs to be returned as UserInterface.
Sylius\Bundle\CoreBundle\OAuth\UserProvider
public function loadUserByOAuthUserResponse(UserResponseInterface $response)
{
$user = $this->oauthRepository->findOneBy(array(
'provider' => $response->getResourceOwner()->getName(),
'identifier' => $response->getUsername()
));
if (null !== $user) {
return $user; // Error here!
}
if (null !== $response->getEmail()) {
$user = $this->userManager->findUserByEmail($response->getEmail());
if (null !== $user) {
return $this->updateUserByOAuthUserResponse($user, $response);
}
}
return $this->createUserByOAuthUserResponse($response);
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels