-
Notifications
You must be signed in to change notification settings - Fork 2k
feat(users): change username to usernameOrEmail in signin #1545
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Found just one thing to nitpick.
$or: [{ | ||
username: usernameOrEmail.toLowerCase() | ||
}, { | ||
email: usernameOrEmail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Emails are always saved lowercase in the db, so it's safe to set this usernameOrEmail.toLowerCase()
as well. Otherwise I won't be able to login when writing e.g. "Fred@example.com".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed (:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
We've been running pretty much identical signup controller for over a year now. Works great — no more "I forgot my username" support mails. |
Looks good, thanks @itelo ! |
It's quite boring to force your users to remember the username they've created in your app to signin. So I've made an option to put an email or username. It's far more interesting to user experience, and a lot of applications are doing that, eg. Snapchat.