Skip to content

Commit

Permalink
Merge pull request #230 from CybercentreCanada/hotfix/uwsgi
Browse files Browse the repository at this point in the history
hotfix/uwsgi
  • Loading branch information
cccs-sgaron authored Jul 16, 2021
2 parents 9664d9e + 9718029 commit 7fad016
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion assemblyline_ui/api/v4/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,9 @@ def logout(**_):
}
"""
try:
KV_SESSION.pop(flsk_session.get('session_id', None))
session_id = flsk_session.get('session_id', None)
if session_id:
KV_SESSION.pop(session_id)
flsk_session.clear()
res = make_api_response({"success": True})
res.set_cookie('XSRF-TOKEN', '', max_age=0)
Expand Down
4 changes: 3 additions & 1 deletion assemblyline_ui/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ def handle_401(e):
"allow_signup": config.auth.internal.signup.enabled,
"allow_pw_rest": config.auth.internal.signup.enabled
}
KV_SESSION.pop(flsk_session.get('session_id', None))
session_id = flsk_session.get('session_id', None)
if session_id:
KV_SESSION.pop(session_id)
flsk_session.clear()
res = make_api_response(data, msg, 401)
res.set_cookie('XSRF-TOKEN', '', max_age=0)
Expand Down

0 comments on commit 7fad016

Please sign in to comment.