How to save extra info during user signup process using firebase authentication

前端 未结 4 1331
悲哀的现实
悲哀的现实 2021-01-07 02:59

I\'m building a website where I\'ve integrated firebase authentication for login/signup of site users.

Users can login/signup via either email-password or mobile OTP

4条回答
  •  梦谈多话
    2021-01-07 03:20

    Since you want to save a user's data. I assume you are saving the data to be able to do some operations on it later. Thus it is advisable you should save your data in cloud firestore. Cloud Firestore's queries will help you in the future to be able to manipulate any CRUD operations that you may want on the data.

    A good way of storing the data is after registering the user with firebase auth. You can take the userID returned by firebase auth in the oncomplete listener, then take make a document with its key being the userID inside your USERS collection,then you save the extra information about the user in that document.

提交回复
热议问题