How to store username and photourl in firebase auth web

后端 未结 1 1545
挽巷
挽巷 2021-01-28 00:30

I am trying out firebase auth. I want to store a photo-url and a username when the user signs up. My code for signing up -

const email = signupForm[\'email\'].val         


        
相关标签:
1条回答
  • 2021-01-28 01:22

    Firebase Authentication doesn't have a user property that stores username. You would have to store that on your own, in a database, and make sure the string is unique.

    You can store a profile picture URL using updateProfile(). It will not store the image for you - you can only provide a URL. If you need to store the image file itself, tou should probably consider using another product for that, such as Cloud Storage.

    Typically, if you have custom information to store per user, you should do that in a database using the unique ID of the user signed in. This gives you full control, rather than depending on what Firebase Auth provides (which is not much). The purpose of Auth is to validate the user's identity, not store per-user information.

    0 讨论(0)
提交回复
热议问题