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