【问题标题】:There is no user record corresponding to this identifier. The user may have been deleted没有与此标识符对应的用户记录。该用户可能已被删除
【发布时间】:2019-05-20 17:29:54
【问题描述】:

没有与此标识符对应的用户记录。该用户可能已被删除。

export const createEmployee = ({ email, password}) => {
  return (dispatch) =>{`
    firebase.auth().createUserWithEmailAndPassword ( email,password )
    .then(
      firebase.auth().signInWithEmailAndPassword( email,password )
      .then(Actions.profile())
    )
  };
};

【问题讨论】:

  • 赶上看看你是否有错误。 .catch(function(error) ...
  • 没有错误,但感谢帮助我深入挖掘

标签: firebase react-native firebase-authentication


【解决方案1】:

根据official documentationcreateUserWithEmailAndPassword成功后用户自动登录

通过传递新用户的电子邮件地址和 createUserWithEmailAndPassword 的密码:

firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {
  // Handle Errors here.
  var errorCode = error.code;
  var errorMessage = error.message;
  // ...
});

如果创建了新帐户,用户会自动登录。 查看下面的后续步骤部分以获取登录用户 细节。 [...]

看看这个SO question

因此,在您的承诺中,您可以像这样获得已经通过身份验证的用户:

var user = firebase.auth().currentUser;

无需拨打signInWithEmailAndPassword

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-04-20
    • 1970-01-01
    • 2019-08-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-18
    • 2019-06-02
    相关资源
    最近更新 更多