Angular 检查电子邮件是否已在ionic和firebase中验证
在用户登录后,我想检查他正在使用的电子邮件是否经过验证。 我以前是这样做的Angular 检查电子邮件是否已在ionic和firebase中验证,angular,firebase,ionic-framework,firebase-authentication,Angular,Firebase,Ionic Framework,Firebase Authentication,在用户登录后,我想检查他正在使用的电子邮件是否经过验证。 我以前是这样做的 import * as firebase from 'firebase'; verified=false; if(firebase.auth().currentUser.emailVerified){ this.verified=true; }else ... 但是现在firebase.auth().currentUser.emailVerified不再工作了。 我会在登录后检查电子邮件是否经过验证,因为如果用户请求
import * as firebase from 'firebase';
verified=false;
if(firebase.auth().currentUser.emailVerified){
this.verified=true;
}else ...
但是现在firebase.auth().currentUser.emailVerified
不再工作了。
我会在登录后检查电子邮件是否经过验证,因为如果用户请求发送电子邮件验证,第一次可能无法工作。尝试以下方法:
const autur = firebase.auth();
autur.onAuthStateChanged(user => {
const veri = user.emailVerified;
if (veri) {
// do something
}
});
谢谢你的帮助,但它不起作用。它给了我一个错误。“auth()不存在于'typeof import node_modules/firebase/index'类型上。”我在爱奥尼亚的文档中读到,auth()和emailVerified现在已不推荐使用。