cb = function(user) {
    if (user) {
      var credential =
          firebase.auth.EmailAuthProvider.credential(email, password);
      // For anonymous user upgrade, call link with credential on the external
      // Auth user. Otherwise merge conflict will always occur when linking the
      // credential to the external anonymous user after creation.
      return /** @type {!firebase.Promise<!firebase.auth.UserCredential>} */ (
          user.linkWithCredential(credential));
    } else {
      // Start create user with email and password. This runs on the internal
      // Auth instance as finish sign in will sign in with that same credential
      // to developer Auth instance.
      return /** @type {!firebase.Promise<!firebase.auth.UserCredential>} */ (
          self.getAuth().createUserWithEmailAndPassword(
              email, password));
    }
  }
Create a new email and password account.
@param {string} email The email to sign up with.
@param {string} password The password to sign up with.
@return {!firebase.Promise<!firebase.auth.UserCredential>}