Commit 39372520 authored by Łukasz Nowak's avatar Łukasz Nowak

Continue fixing: fetch and return expiration time.

parent a24b66a4
...@@ -62,7 +62,7 @@ if state:\n ...@@ -62,7 +62,7 @@ if state:\n
query_dict[\'state\'] = state\n query_dict[\'state\'] = state\n
person = context.ERP5Site_getAuthenticatedMemberPersonValue()\n person = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
try:\n try:\n
token = person.Person_getBearerToken()\n token, expires = person.Person_getBearerToken()\n
except ValueError:\n except ValueError:\n
query_dict[\'error\'] = \'server_error\'\n query_dict[\'error\'] = \'server_error\'\n
if \'#\' in redirect_uri:\n if \'#\' in redirect_uri:\n
...@@ -72,9 +72,9 @@ except ValueError:\n ...@@ -72,9 +72,9 @@ except ValueError:\n
return context.REQUEST.RESPONSE.redirect( redirect_uri )\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,\n
token_type=\'bearer\',\n token_type=\'bearer\',\n
expires_in=str(int((token.getExpirationDate() - DateTime()) * 24 * 3600)),\n expires_in=str(int((expires - DateTime().timeTime()))),\n
)\n )\n
if state:\n if state:\n
query_dict[\'state\'] = state\n query_dict[\'state\'] = state\n
......
369 370
\ 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