As an example:
firebase.auth().createUserWithEmailAndPassword(email, password).catch(function (error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
// [START_EXCLUDE]
if (errorCode == 'auth/weak-password') {
alert('The password is too weak.');
exit;
} else {
alert(errorMessage);
exit;
}
console.log(error);
// [END_EXCLUDE]
});
This function only handles user creation and error verification, without indicating whether the user was successfully created. In order to take actions like saving the user's name in the database or redirecting upon successful creation, you need additional steps.
Is there a way to trigger actions after a successful createUserWithEmailAndPassword call?