gapi.auth2.ExternallyVisibleError:无效的cookiePolicy [英] gapi.auth2.ExternallyVisibleError: Invalid cookiePolicy

查看:141
本文介绍了gapi.auth2.ExternallyVisibleError:无效的cookiePolicy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Google登录身份验证系统添加到我的应用中,但是我不断收到一个奇怪的错误,我没有看到任何人得到.我使用的是 google示例代码.

I'm trying to add a Google Sign In Authentication system to my app, but I keep getting a strange error that I haven't seen anyone get. I'm using EXACTLY the google example code.

我认为加载api时可能会出现一些错误,因此我检查了异步加载,并且一切似乎都已正确加载,但是我一直在控制台中收到此错误:

I thought it could be some mistake when loading the api, so I checked the async loading and everything seems to be loading properly, but I keep getting this error in the console:

gapi.auth2.ExternallyVisibleError:无效的cookiePolicy

gapi.auth2.ExternallyVisibleError: Invalid cookiePolicy

我到处搜索有相同问题的人,但是找不到类似的东西.

I searched everywhere for people with the same problem, but I could not find anything similar.

有什么想法吗?

编辑:我尝试仅使用教程代码创建页面,但仍会发生错误.

I tried to create a page with ONLY the code of the tutorial, but the error still occurs.

推荐答案

好吧,事实证明,我试图通过直接在本地访问文件(index.html)来测试API. Google登录API仅在运行中的网络服务器上有效.我启动了一个简单的node.js服务器,并通过该服务器运行了我的应用,一切正常.

Well, turns out I was trying to test the API by directly acessing my files locally (index.html). The Google Sign In API only works in a running web server. I started a simple node.js server, ran my app trhough this server, and everthing worked just fine.

这篇关于gapi.auth2.ExternallyVisibleError:无效的cookiePolicy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆