我使用Google Plus作为登录,直到最近才运行良好.现在用户无法再退出.回调工作并返回用户已注销的内容,但之后会立即再次签署用户.好像它没有存储注销.
有一些老问题就像这个问题.我尝试了所有提议的解决方案但没有任何效果
html头中的代码
<script src="https://apis.google.com/js/client:platform.js?onload=start" async defer></script>
Run Code Online (Sandbox Code Playgroud)
按钮代码,始终显示(登录时隐藏)
<div id="signinButton">
<span class="g-signin"
data-scope="https://www.googleapis.com/auth/gmail.readonly"
data-clientid="{{ CLIENT_ID }}"
data-redirecturi="postmessage"
data-accesstype="offline"
data-cookiepolicy="single_host_origin"
data-callback="signInCallback">
</span>
</div>
Run Code Online (Sandbox Code Playgroud)
SignIn和SignOut函数
<script>
function signInCallback(authResult) {
//console.log(authResult)
if (authResult['code']) {
var state = encodeURIComponent('{{ STATE }}');
var code = encodeURIComponent(authResult['code']);
var tz = encodeURIComponent($('#timezone').val());
var cntry = encodeURIComponent($('#country').val());
var lan = encodeURIComponent('{{ language }}');
// Send the code to the server
$.ajax({
type: 'POST',
url: '/signup/gauth',
contentType: 'application/octet-stream; charset=utf-8',
success: function(result) {
console.log(result)
if (result == …Run Code Online (Sandbox Code Playgroud) 我在Python/Google App Engine上使用GMail API.我有一个返回某些线程ID的查询,现在我想得到每个线程的最后一条消息.由于结果不一定按日期排序,我想知道什么是最有效的API调用呢?
根据以下评论,我设置了以下批处理功能:
if threads != []:
count = 0 #start a new batch request after every 1000 requests
batch = BatchHttpRequest(callback=get_items)
for t in threads:
batch.add(service.users().threads().get(userId=email, id=t), request_id=some_id)
count += 1
if count % 1000: #batch requests can handle max 1000 entries
batch.execute(http=http)
batch = BatchHttpRequest(callback=get_items)
if not count % 1000:
batch.execute(http=http)
Run Code Online (Sandbox Code Playgroud)
然后执行get_items,其中包括跟随逻辑运行以查明线程中的最后一封电子邮件是否是已发送的项目.
def get_items(request_id, response, exception):
if exception is not None:
print 'An error occurred: %s' % exception
else:
for m in response['messages']: #check each of …Run Code Online (Sandbox Code Playgroud) 我在我的网页上使用 Google Sign-in Javascript 库,该库在 Google App Engine 上的 Python 上运行。一切正常,除非用户禁用了 3rd 方 cookie(在 Chrome 中)。注册会打开帐户选择器(如果适用)并请求权限,但之后什么也没有发生。
在桌面上,它返回到注册页面并在控制台中显示以下错误:
Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document.
Run Code Online (Sandbox Code Playgroud)
但是我无法检测到此错误,因此我也无法对其做出响应。在移动设备上,它只会卡在白页上。这里的另一个问题是,由于我要求离线访问,因此第一次注册会返回一个 refresh_token。由于这个错误,我从未收到过这个 refresh_token。
当我加载页面时,上面提到的错误会立即显示。我想检测到这一点,以便我可以决定不显示按钮并要求用户启用 3rd 方 cookie。
由于未知原因,我在 Google App Engine 上的网站突然无法在多个设备和不同浏览器中加载。它给出了 DNS_PROBE_FINISHED_NXDOMAIN 错误。我尝试重新启动 DNS 服务,将 DNS 更改为 Google 的,然后重新启动设备。到目前为止没有任何帮助。所有其他网站加载没有问题。什么可能导致这种情况?
我想在我的GAE应用程序的非默认版本上使用SSL.对于正常的https://my-app.appspot.com我知道我不需要做任何事情.但是我有另一个版本,它将在https://v2.my-app.appspot.com下,并且SSL不起作用.它在浏览器中出现以下错误:
你的连接不是私人的
攻击者可能试图从dev.replimeapp.appspot.com窃取您的信息(例如,密码,邮件或信用卡).NET :: ERR_CERT_COMMON_NAME_INVALID
我想检查一个电子邮件地址是否等于3个不同数组中任何字符串的子字符串.不幸的是,我写的函数不断给出"无法识别的表达式"错误.
var search = 'info@example.com'
jQuery.each(array1, array2, array3, jQuery(function(index, value) {
jQuery.each(value, jQuery(function(key, cell) {
if (jQuery(search).indexOf(cell) !== -1)
console.log('Found email in ' + index, cell)
}))
}))
Run Code Online (Sandbox Code Playgroud)
这会引发以下错误:
Uncaught Error: Syntax error, unrecognized expression: info\\@example\\.com
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
javascript ×2
dns ×1
gmail-api ×1
google-api ×1
google-oauth ×1
google-plus ×1
https ×1
jquery ×1
python ×1
ssl ×1