我已成功设置Firebase电子邮件/密码身份验证,但出于安全考虑,我希望用户确认她/他的电子邮件.它在Firebases网站上说:
当用户使用电子邮件地址和密码注册时,会发送确认电子邮件以验证其电子邮件地址.
但是当我注册时,我没有收到确认电子邮件.
我看过,只能找到发送密码重置电子邮件的代码,但不能找到发送电子邮件确认的代码.
我看过这里:
https://firebase.google.com/docs/auth/ios/manage-users#send_a_password_reset_email
有谁知道我怎么做?
我有一个关于 firebase 电子邮件验证如何工作的问题。
案件:
已经登录的用户(在设备 A 中)发生了什么?firebase 是将他们注销还是只是验证新电子邮件,但仍使用当前用户登录?
我检查了用户是否通过电子邮件进行了验证.但是,无论我发送多少封电子邮件并确认,验证状态仍然存在false.我在检查时做错了什么?
FIRAuth.auth()?.addStateDidChangeListener({ (auth, user) in
if (auth.currentUser?.isEmailVerified)!{
let mainStoryboard: UIStoryboard = UIStoryboard(name:"Main",bundle:nil)
let NewPostViewController: UIViewController = mainStoryboard.instantiateViewController(withIdentifier: "NewPostViewController")
//Send the user to the LoginViewController
self.present(NewPostViewController, animated: true, completion: nil)
}else{
let alertVC = UIAlertController(title: "Error", message: "Sorry. Your email address has not yet been verified. Do you want us to send another verification email to \(self.currentUser.generalDetails.email).", preferredStyle: .alert)
let alertActionOkay = UIAlertAction(title: "Okay", style: .default) {
(_) in
FIRAuth.auth()?.currentUser?.sendEmailVerification(completion: nil)
}
let alertActionCancel = UIAlertAction(title: "Cancel", style: .default, …Run Code Online (Sandbox Code Playgroud)