繁体   English   中英

Firebase电子邮件验证未发送

[英]Firebase email verification not sending

填写注册表单后,我在react应用中实现了发送确认电子邮件的功能,并尝试使用自己的电子邮件在本地进行测试,但是我没有收到任何电子邮件,控制台也没有记录我的消息,但仍然将数据写入数据库,我可以在Firebase控制台的“身份验证”选项卡中看到自己作为用户

用户提交表单时:

handleSubmit(e) {
    e.preventDefault();
    firebase.auth()
    .createUserWithEmailAndPassword(this.state.emailValue, this.state.passValue) 
    .then(() => {
        this.setState({
            showErrorMessage: false
        })
        var user = firebase.auth().currentUser;
        writeUserData(user.uid, this.state.name, this.state.emailValue)
        user.sendEmailVerification().then(() => {
            console.log("verification email sent")
        }).catch((error)=>console.error(error))
    })
    .catch((error) => {
        this.setState({
            error: error,
            showErrorMessage: true,
        })
        console.error(error)
    })
}

装入表单组件时:

componentWillMount() {
        firebase.auth().onAuthStateChanged((user) => {
            if (user) {
                window.location = "thank-you"
            } 
        })
    }

提交以下表单时,我在控制台中收到此错误: {code: "auth/network-request-failed", message: "A network error (such as timeout, interrupted connection or unreachable host) has occurred."}

我究竟做错了什么? 我正在关注所有的firebase文档

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM