Skip to content

Commit

Permalink
Merge pull request #165 from sennetconsortium/maxsibilla/idle-fix
Browse files Browse the repository at this point in the history
Updating cookie expiration to better handle portal authentication issue
  • Loading branch information
maxsibilla authored Oct 5, 2023
2 parents 8b88fd5 + 7e34119 commit d3bfc2d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/routes/auth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@ def _login(redirect_uri, key = 'tokens'):

# create a response for the user
response = make_response(redirect(redirect_uri))
#Use max_age (seconds) as opposed to expires (date). Set token to expire after 1 day
if current_app.config['COOKIE_DOMAIN'] == 'localhost':
response.set_cookie('info', base64_json_str, expires=2**31 - 1)
response.set_cookie('info', base64_json_str, max_age=86400)
else:
response.set_cookie('info', base64_json_str, expires=2**31 - 1, domain=current_app.config['COOKIE_DOMAIN'])
response.set_cookie('info', base64_json_str, max_age=86400, domain=current_app.config['COOKIE_DOMAIN'])
return response


Expand Down

0 comments on commit d3bfc2d

Please sign in to comment.