Commit e2699175 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Fix google callback

include n.me is mandatory.
parent 153e5452
...@@ -33,7 +33,13 @@ elif code is not None: ...@@ -33,7 +33,13 @@ elif code is not None:
method = getattr(context, "ERP5Site_createGoogleUserToOAuth", None) method = getattr(context, "ERP5Site_createGoogleUserToOAuth", None)
if method is not None: if method is not None:
method(user_reference, user_dict) method(user_reference, user_dict)
return context.REQUEST.RESPONSE.redirect(
context.REQUEST.get("came_from") or context.absolute_url())
return handleError('') person_relative_url = context.ERP5Site_getPersonFromGoogleLogin(user_reference)
came_from = context.absolute_url() + "/#!login?n.me=%s" % person_relative_url
context.REQUEST.RESPONSE.setHeader('Location', came_from)
context.REQUEST.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