Skip to content

Commit

Permalink
Auth: guard against user being removed (#6908)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximlt committed Jun 12, 2024
1 parent cd8b190 commit 08c6a3e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion panel/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,9 @@ def _remove_user(self, session_context):
state._active_users[user] -= 1
if not state._active_users[user]:
del state._active_users[user]
if user in state._oauth_user_overrides:
# Don't remove the user override when it is set to None or
# is missing, as this means it is being refreshed.
if state._oauth_user_overrides.get(user) is not None:
del state._oauth_user_overrides[user]

def _schedule_refresh(self, expiry_ts, user, refresh_token, application, request):
Expand Down

0 comments on commit 08c6a3e

Please sign in to comment.