News for hackers. Stuff that matters.
Re:Ask HN: Should a login be a Username or an Email? by yladiz on Sunday July 02, 2017 @04:28AM (#14681507)
When they sign up, they probably have to choose (at least) one of those options, so that can be included on their profile and the data can be separated from the profile. E.g. Your "profile" in the db can say "login_type: phone_number", which is supplied when you sign up or your profile is created, and then you can do a lookup on the respective table. You could likely make it simpler and just include it in the profile table (phone_number, username, email columns) since there would only be a set amount of login types (unless you somehow make it generic and augmentable from a UI).

There are no comments on this comment yet.