我正在处理一个Web项目,我想使用Firebase身份验证。
问题是,当我致电createUserWithEmailAndPassword
时,它在CORS飞行前检查失败。当我的本地主机通过http服务时,响应包含https://localhost:3000。有解决此问题的简便方法吗?
编辑: 完整的错误消息是:
Failed to load https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=<key>: Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header has a value 'https://localhost:3000' that is not equal to the supplied origin. Origin 'http://localhost:3000' is therefore not allowed access.
更新
我最终创建了一个云功能端点,因为无论如何我都必须进行一些经过验证的数据库更新。