I tihnk that user names are the thing of the past and e-mail address is now the default way of logging into websites. So I think we should get rid of the user name as the default login "name" and start using e-mails.

This way we can drop the double check for user name and e-mail address when creating new accounts programatically.

It would be nice to be able to log in with e-mail address since usernames can be easily forgotten.

CommentFileSizeAuthor
#2 email-login-support.patch3.71 KBAnonymous (not verified)
#1 UserLoginForm-email-login.patch3 KBAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Status: Active » Needs review
FileSize
3 KB

This patch allows user to login with e-mail address.
UserPasswordForm form already works with e-mail address.
AccountFormController - to do. I'm not sure if the logic should go into the form or into the user_validate_name()

Anonymous’s picture

FileSize
3.71 KB

Here are both forms.
I hope it works since I have to manually edit every patch from PHPStorm to suit d.o

Anonymous’s picture

Title: Make e-mail address the default way of logging in » Allow users to log in with e-mail as username

Changed the title.

Anonymous’s picture

Issue summary: View changes
Anonymous’s picture

Issue summary: View changes

This patch basically tries to load the user by e-mail address if it was not loaded via username + on register/account form it prevents usage of username that is an e-mail address assigned to another account.

+ Fixed the strike-through in first comment..

Pancho’s picture

Status: Needs review » Closed (duplicate)
Related issues: +#111317: Allow users to login using either their username OR their e-mail address

Duplicate of #111317

Anonymous’s picture

Status: Closed (duplicate) » Needs review

Thanks, good to know.
Though I'll leave this open since it has working D8 patch.

dawehner’s picture

Status: Needs review » Closed (duplicate)

You can copy over the existing patch to the other issue ... the other issue contains probably a lot of valueable discussion.

Anonymous’s picture

I just realized that one thing is missing: restriction upon user entity when it's created programmatically(or imported/migrated).
If this new entity has the same e-mail address as another user's user name it should now be created.