简体   繁体   English

为什么旧的 Email 在 firebase 和 VUE.JS 更新后返回?

[英]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.

相关问题 Vue.js 使用 SendGrid v3 发送 email:不允许访问 - Vue.js sending email with SendGrid v3 : not allowed access 显示数据 来自 Firebase RTDB 使用 Vue.js - Display data From Firebase RTDB using Vue.js Firebase Vue.js 电话号码认证不起作用 - Firebase phone number authentication with Vue.js does not work Uncaught FirebaseError: Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() (app/no-app) in vue.js - Uncaught FirebaseError: Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() (app/no-app) in vue.js 无法从 firebase 上托管的 vue.js 项目调用 api 到存储在第三方服务器中的后端 node.js - unable to make api call from vue.js project hosted on firebase to node.js backend stored in third party server 如何在vue.js中持续读取firebase实时数据库的数据变化 - How to continiously read data change from firebase realtime database in vue.js Laravel 和 Vue.js 中的亚马逊支付整合 - Amazon payment integeration in Laravel and Vue.js Vue.js 无法读取未定义的属性“集合” - Vue.js Cannot read property 'collection' of undefined 注册时出现 POST 400 错误 - Vue JS / Firebase - POST 400 error on signup - Vue JS / Firebase 努力从 useDocument 获取数据以显示 vue.js 和 Firestore - Struggling to get the data from useDocument to display with vue.js and Firestore
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM