错误:未定义不是对象(正在评估“ firebase.auth.EmailAuthProvider.credential”)

时间:2019-03-23 10:01:58

标签: react-native react-native-firebase

我不知道这段代码有什么问题。我正在尝试在项目中实现更改用户密码模块,但遇到错误undefined is not an object (evaluating 'firebase.auth.EmailAuthProvider.credential')

const emailCred = firebase.auth.EmailAuthProvider.credential(email, oldPassword);

firebase
    .auth()
    .currentUser.reauthenticateWithCredential(emailCred)
    .then(() =>
      firebase
        .auth()
        .currentUser.updatePassword(newPass)
        .then(() =>
          dispatch({
            type: CHANGE_PASS
          })
        )
        .catch(e =>
          dispatch({
            type: ERROR,
            payload: e
          })
        )
    )
    .catch(e => {
      dispatch({
        type: ERROR,
        payload: e
      });
    });

0 个答案:

没有答案