我不知道这段代码有什么问题。我正在尝试在项目中实现更改用户密码模块,但遇到错误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
});
});