What are the pros and cons of using an email address as a user id?

前端 未结 15 1598
离开以前
离开以前 2021-01-29 20:15

I\'m creating a web app that requires registration/authentication, and I\'m considering using an email address as the sole user id. Here are what I see as the pros and cons (upd

15条回答
  •  独厮守ぢ
    2021-01-29 20:41

    If you don't care about forcing your users to login to your application with Facebook or some other social network (most people don't seem to care), then you can just use their social network email as their 'user id' when referencing other tables/documents (MySQL, Mongo, etc).

    I've noticed the bonus to using social media logins is that all the security has been taken care of by said social network, including not allowing 2 users to have the same email or username in their database thus saving you the hassle of having to code for all of that. This is just my personal preference.

提交回复
热议问题