FOSUserBundle
FOSUserBundle copied to clipboard
Reset password only by username or email (but not both)
I removed the uniqueness of the email in my database (many user can register with same email), but user can request a reset by email. Only the first user with that email receive the email (and worse, the user that receive the email is not the one who asked for the reset).
Do you think it's a good idea to include a feature in the bundle to allow reset only by email or username, or do you think it's too specific and this should be handled by overrides ?
I think, that it is really bad to remove uniqueness of email.
Please don't do it. It is not good.
I know it's not good, but that's not the point.
The point it to enable users to reset their password only with the username or only with the email. Is it a feature to include in the bundle or not.
You could write an event listener that checks if the user provided a valid username OR email for the reset request. The FOSUserBundle triggers a lot of events, as seen here: FOSUserEvents.php
I had to remove the uniqueness of the email too. (Email are provided by some client API and they are not unique...)
It would be nice to allow reset only by username.