According to Firebase site, I am using this code to create a new user:
firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error)
Simply you can solve your problem as follow.
1) Create a user using following statement.
firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {});
2) success of above statement Please authenticate this user as follow.
self.rootRef.authUser(email, password)
// USER_ID = Here you get user_ID
3) Success of above function set user name and profile picture to user as follow.
usersRef.updateChildValues(dict, withCompletionBlock:
-Here userRef contain your userDetails/USER_ID
Might be work for you. i have code but work for older firebase version so not work for you otherwise i had share with you.