How to add username with email and password in Firebase?

后端 未结 3 1619
野趣味
野趣味 2021-02-05 15:51

I\'m using Firebase and I\'m trying to add a username to the database with the email and password.

\"This

3条回答
  •  走了就别回头了
    2021-02-05 16:37

    You can create a users endpoint and store custom user data in there.

    function writeUserData(userId, name, email, imageUrl) {
      firebase.database().ref('users/' + userId).set({
        username: name,
        email: email,
        profile_picture : imageUrl,
        // Add more stuff here
      });
    }
    

    Have a look to https://firebase.google.com/docs/database/web/read-and-write

提交回复
热议问题