我尝试进行电子邮件验证,但问题是该应用在未发送电子邮件的情况下注册了用户
这是我的函数代码
Future<String> registerUsingEmailAndPassword(String email, String password) async {
UserCredential userCredential = await firebaseAuth.createUserWithEmailAndPassword(email: email, password: password);
User user = userCredential.user;
if(!user.emailVerified){
await user.sendEmailVerification();
print(user.email);
}
return user.uid;
}
这是我的日志
W/System ( 3599): Ignoring header X-Firebase-Locale because its value was null.
W/System ( 3599): Ignoring header X-Firebase-Locale because its value was null.
D/FirebaseAuth( 3599): Notifying id token listeners about user ( Q8d7R7mE9dOv5lAbkZH2UCiwmKA2 ).
D/FirebaseAuth( 3599): Notifying auth state listeners about user ( Q8d7R7mE9dOv5lAbkZH2UCiwmKA2 ).
W/System ( 3599): Ignoring header X-Firebase-Locale because its value was null.
I/flutter ( 3599): wasee.2132254@gmail.com
编辑
当我检查我的电子邮件时,我发现了这些消息,所以,想要做一些类似等待用户验证然后继续注册过程的等待屏幕
有什么想法吗?
答案 0 :(得分:0)
我认为您可以检查 Firebase User user.isEmailVerified
是否正确