Commit 8980a36a authored by Roque's avatar Roque

slapos_jio: fix google callback cookie

parent e141fbb7
......@@ -19,7 +19,8 @@ elif code is not None:
if response_dict is not None:
access_token = response_dict['access_token'].encode('utf-8')
hash_str = context.Base_getHMAC(access_token, access_token)
context.REQUEST.RESPONSE.setCookie('__ac_google_hash', hash_str, path='/')
response = context.REQUEST.RESPONSE
context.setAuthCookie(response, '__ac_google_hash', hash_str)
# store timestamp in second since the epoch in UTC is enough
response_dict["response_timestamp"] = time.time()
context.Base_setBearerToken(hash_str,
......@@ -38,8 +39,8 @@ elif code is not None:
came_from = context.absolute_url() + "/#!login?n.me=%s" % person_relative_url
context.REQUEST.RESPONSE.setHeader('Location', came_from)
context.REQUEST.RESPONSE.setStatus(303)
response.setHeader('Location', came_from)
response.setStatus(303)
else:
return handleError('')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment