I only want to have email as mode of login, I don\'t want to have username. Is it possible with symfony2/symfony3 and FOSUserbundle?
I read here http://groups.google
As of Sf 2.3, a quick workaround is to set the username to any string in the _construct of your class User that extends BaseUser.
public function __construct()
{
parent::__construct();
$this->username = 'username';
}
This way, the validator wont trigger any violation. But don't forget to set the email to the username as posted by Patt.
public function setEmail($email)
{
$email = is_null($email) ? '' : $email;
parent::setEmail($email);
$this->setUsername($email);
}
You may have to check other files for references to User:username and change accordingly.