In my firebase web app when new users signup with their email i create a node under their email adress under the root ref
But the problem is using push() method to
Calling push
generates a location with an auto-calculated key.
To write a child at a path that you determine the key yourself, you simply call child("key").set(value)
.
If you store Firebase Authentication users in your database, the idiomatic way is to store them under their uid.
var user = firebase.auth().currentUser;
var usersRef = firebase.database().ref("users");
if (user) {
usersRef.child(user.uid).set({
displayName: displayName,
email: email,
photoUrl: photoUrl,
emailVerified: emailVerified
});
}