I have FOSUser working and now attempting to add Google/Facebook sign-up, meaning that I will still sign up users with regular FOSUser setup.
I know about HWIOAuthBundle but I am reluctant to add another bundle. Already having second thoughts about FOS bundle itself after all the overriding I already did.
When creating the user with the info coming from Google I am of course getting the error that the password field cannot be null.
This is the function creating user in my controller:
private function registerUser($payload) {
$user = $this->userManager->createUser();
$user->setEmail($payload['email']);
$user->setUsername($payload['given_name'] . '-' . mt_rand()); // temporary username
$this->userManager->updateUser($user);
}
Looking at this SO question, I added the password field to my modified User entity, but Doctrine:migration is not catching it:
/**
* @ORM\Entity
* @ORM\Table(name="`user`")
*/
class User extends BaseUser
{
.....
/**
* @ORM\Column(type="string", name="password", nullable=true)
*/
protected $password;
I may be taking the wrong path and in that case I appreciate any guidance.