Skip to content

Commit

Permalink
Updating cookie expiration to better handle portal authentication issue
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsibilla committed Oct 4, 2023
1 parent e4068fa commit 7e34119
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 7e34119

Please sign in to comment.