Commit 95c5beef authored by Łukasz Nowak's avatar Łukasz Nowak

Avoid eating fragment.

Client might want to do anything with it, so append responso to such.
parent 0786e092
......@@ -50,19 +50,24 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from ZTUtils import make_query\n
\n
from DateTime import DateTime\n
<value> <string encoding="cdata"><![CDATA[
from ZTUtils import make_query\n
\n
query_dict = dict()\n
url = redirect_uri.split(\'#\')[0]\n
\n
if state:\n
query_dict[\'state\'] = state\n
\n
query_dict[\'error\'] = \'access_denied\'\n
return context.REQUEST.RESPONSE.redirect( url + \'#\' + make_query(query_dict) )\n
</string> </value>
if \'#\' in redirect_uri:\n
redirect_uri += \'&\' + make_query(query_dict)\n
else:\n
redirect_uri += \'#\' + make_query(query_dict)\n
return context.REQUEST.RESPONSE.redirect( redirect_uri )\n
]]></string> </value>
</item>
<item>
<key> <string>_params</string> </key>
......
......@@ -50,12 +50,13 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from ZTUtils import make_query\n
<value> <string encoding="cdata"><![CDATA[
from ZTUtils import make_query\n
\n
from DateTime import DateTime\n
\n
query_dict = dict()\n
url = redirect_uri.split(\'#\')[0]\n
\n
if state:\n
query_dict[\'state\'] = state\n
......@@ -64,7 +65,11 @@ try:\n
token = context.getPortalObject().bearer_token_module.BearerTokenModule_addNewToken(person.getReference())\n
except ValueError:\n
query_dict[\'error\'] = \'server_error\'\n
return context.REQUEST.RESPONSE.redirect( url + \'#\' + make_query(query_dict) )\n
if \'#\' in redirect_uri:\n
redirect_uri += \'&\' + make_query(query_dict)\n
else:\n
redirect_uri += \'#\' + make_query(query_dict)\n
return context.REQUEST.RESPONSE.redirect( redirect_uri )\n
\n
query_dict = dict(\n
access_token=token.getReference(),\n
......@@ -76,8 +81,14 @@ if state:\n
\n
query = make_query(query_dict)\n
\n
return context.REQUEST.RESPONSE.redirect( url + \'#\' + query )\n
</string> </value>
if \'#\' in redirect_uri:\n
redirect_uri += \'&\' + make_query(query_dict)\n
else:\n
redirect_uri += \'#\' + make_query(query_dict)\n
return context.REQUEST.RESPONSE.redirect( redirect_uri )\n
]]></string> </value>
</item>
<item>
<key> <string>_params</string> </key>
......
366
\ No newline at end of file
367
\ No newline at end of file
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