.createUserWithEmailAndPassword and .updateProfile Methods

2,072 views
Skip to first unread message

Ron Royston

unread,
Jul 26, 2016, 5:28:57 PM7/26/16
to Firebase Google Group
Why doesn't .createUserWithEmailAndPassword take displayName and photoURL arguments?  It would be so much easier...

Ron Royston

unread,
Jul 26, 2016, 6:30:10 PM7/26/16
to Firebase Google Group
In case anyone needs it:

                registerPasswordUser(email,displayName,password,photoURL){
                   
var user = null;
                   
//nullify empty arguments
                   
for (var i = 0; i < arguments.length; i++) {
                        arguments
[i] = arguments[i] ? arguments[i] : null;
                   
}
                   
                    firebase
.auth().createUserWithEmailAndPassword(email, password)
                       
.then(function () {
                            user
= firebase.auth().currentUser;
                            user
.sendEmailVerification();
                       
})
                       
.then(function () {
                            user
.updateProfile({
                                displayName
: displayName,
                                photoURL
: photoURL
                           
});
                       
})
                       
.catch(function(error) {
                            console
.log(error.message,7000);
                       
});
                        console
.log('Validation link was sent to ' + email + '.', 7000);
               
}
Reply all
Reply to author
Forward
0 new messages