[英]why old Email returns after updating it in firebase and VUE.JS?
am trying to allow users to change their primary email in my VUE App which uses firebase as authentication,我试图让用户在我的 VUE 应用程序中更改他们的主要 email,它使用 firebase 作为身份验证,
the code am using works fine and it gives me that the email has been updated, however after the email is updated I can log with the new email for one time only and once I have logged out then like it has never been changed, and the old email is working again.我使用的代码工作正常,它告诉我 email 已更新,但是在 email 更新后,我只能使用新的 email 登录一次,一旦我注销,就像它从未被更改过一样,并且老 email 又开始工作了。
What is am doing wrong that keeps getting the old email assigned with the user我做错了什么,总是让用户分配旧的 email
currently am using the following code:目前正在使用以下代码:
firebase.auth()
.signInWithEmailAndPassword(oldEmailAddress, currentPass)
.then(
() => {
firebase.auth().currentUser.updateEmail(newEmailAddress).then(() => {
console.log('Email Updated');
}).catch((error) => {
console.log('Email Error updating user:', error);
});
},
(err) => {
console.log('log in user error:', err);
}
);
try using this function from firebase/auth as the docs say:尝试使用 firebase/auth 中的这个 function 作为文档说:
const auth = getAuth();
updateEmail(auth.currentUser, "user@example.com").then((result) = { console.log(result) })
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.