How to add additional attributes of phone number and address to this data set? The Firebase documentation does not seem to report anything about this.
I implemented the login, registered and updated using firebase.auth()
Entrance:
//Email Login firebase.auth().signInWithEmailAndPassword(email, password).then( ok => { console.log("Logged in User",ok.user); }, error => { console.log("email/pass sign in error", error); } );
Registration:
//Sign Up firebase.auth().createUserWithEmailAndPassword(email, password).then( ok => { console.log("Register OK", ok); }, error => { console.log("Register error", error); } )
Update:
//User Authentication firebase.auth().onAuthStateChanged(function(user) { if (user) { $scope.data=user; } else { // No user, Redirect to login page } }); //Save Function $scope.save=function(values){ $scope.data.updateProfile({ displayName: "Test User", email: " test@gmail.com ", /* phone: 123412341, address: "Temp Address",*/ photoURL: "www.example.com/profile/img.jpg" }).then(function() { // Update successful. }, function(error) { // An error happened. }); };
source share