Skip to content

Commit

Permalink
[ADD] Added safeguard for logout
Browse files Browse the repository at this point in the history
  • Loading branch information
whikernel committed Dec 9, 2024
1 parent 4c7cd98 commit be52e2e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/app/blueprints/dashboard/dashboard_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@

from oic.oauth2.exception import GrantError

log = app.logger


# CONTENT ------------------------------------------------
dashboard_blueprint = Blueprint(
'index',
Expand Down Expand Up @@ -93,9 +96,12 @@ def logout():
ctx_less=True,
display_in_ui=False
)
except Exception as e:
log.error(f"Error logging out: {e}")
log.warning(f'Will continue to local logout')

track_activity("user '{}' has been logged-out".format(current_user.user), ctx_less=True, display_in_ui=False)
logout_user()
track_activity("user '{}' has been logged-out".format(current_user.user), ctx_less=True, display_in_ui=False)
session.clear()

return redirect(not_authenticated_redirection_url('/'))
Expand Down

0 comments on commit be52e2e

Please sign in to comment.