Add a login field to existing users table

2

What would be the best way to add a login field to an existing database table with more or less 10,000 users. I am currently using MySQL and would like to give a remodeled user table, at the moment the table contains name, email, password, and registration date, and users logged in with email and password only. I would like to put the option to login with username as well.

I thought about adding the login field and popular existing users with random strings, but I do not know if this would be the best way to do this. Would anyone have a more 'right' suggestion to do this?

    
asked by anonymous 05.03.2015 / 06:31

2 answers

4

From the user experience point of view, using emails as a login is often more convenient than using "usernames" ( usernames ). Firstly, because it's more of a user thing to remember ("what username I used on this site?"), Second because e-mails are unique, while username may have already been used, to choose another, etc. If your system works well without usernames, I suggest not introducing them "just for you".

If on the other hand you have reason to want this (eg, it is not good to expose a user's email to others without their consent, and sometimes it is necessary for one to identify the other in some way) , there are two main ways to do this to my understanding:

  • Get a combination of the first name and initials of the surname (or vice versa, depending on what is most common in the culture of these users), perhaps adding a numeric suffix if two are given the same username ; or:
  • Take the first part of your e-mail (before the @) and do the same case two have that same. This exposes a bit more of the user's privacy (it's easier to "guess" your email based on your username ), but I think it depends on the point of view ... (others may prefer not to have its true name revealed, varies from case to case)

Using random strings would have little benefit, as you well questioned, perhaps except if the user is given the opportunity to change his username if he so desires (anyway, it's still annoying. ..). And one final thing: if your table contains a senha field, I hope you're storing it correctly . ;)

    
05.03.2015 / 12:21
1

If the concern is to keep the user's email address confidential during login and in front of other users, there is also a simple option that is to use a type field (INPUT) type (PASSWORD) for entering the Email Address .

    
08.03.2015 / 18:41