According to the official documentation, after the success of createUserWithEmailAndPassword
the user is automatically signed-in.
Create a new account by passing the new user's email address and
password to createUserWithEmailAndPassword:
firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
// ...
});
If the new account was created, the user is signed in automatically.
Have a look at the Next steps section below to get the signed in user
details.
[...]
Look also at this SO question.
So in your promise you can just get you already authenticated user like that:
var user = firebase.auth().currentUser;
No need to make signInWithEmailAndPassword
call.