FOSUserBundle icon indicating copy to clipboard operation
FOSUserBundle copied to clipboard

Check username first on EmailUserProvider.php

Open ghost opened this issue 10 years ago • 3 comments

This issue is related to #1336.

For example we have 2 users:

  1. User "Tom" with email "[email protected]"
  2. User "[email protected]" with email "[email protected]"

Which user should be selected if the input for username is '[email protected]'?

You could do these things: a) Allow usernames only. b) Allow email addresses only. c) Allow both and first look for email address. d) Allow both and first look for username.

Currently you can do everything except the last. I think we should add an option for checking the username first.

ghost avatar Sep 21 '15 17:09 ghost

+1

azine avatar Sep 21 '15 19:09 azine

I don't think this can be fixed correctly using two fields like the username_email provider do, even with an option you will still have one bad behavior, in one way or another.

Also the "c)" option does not exists currently.

damienalexandre avatar Dec 03 '16 13:12 damienalexandre

The situation with the current implementation has changed: see #2650

azine avatar Feb 28 '18 13:02 azine