Is it advisable to store username in user Metadata?
r
rp_st
06/03/2022, 3:58 AM
Hey @dhatguy
rp_st
06/03/2022, 3:58 AM
The user metadata is just a key value store per user.
rp_st
06/03/2022, 3:59 AM
So you can store anything in there, as long as you want to query it using the user id
rp_st
06/03/2022, 4:00 AM
For the case of username, if you want to check if a username is unique, then you will have to loop through all the users, fetch their metadata and then check their usernames. This is as opposed to storing the username yourself and making that a primary key
rp_st
06/03/2022, 4:00 AM
So I wouldn’t advise to store the username in user metadata
rp_st
06/03/2022, 4:00 AM
Unless you don’t care about it being unique. Then it’s fine
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).