django-maintenance-mode icon indicating copy to clipboard operation
django-maintenance-mode copied to clipboard

Logout all users except superusers

Open williwacker opened this issue 1 year ago • 2 comments
trafficstars

I have set:

MAINTENANCE_MODE_IGNORE_SUPERUSER = True
MAINTENANCE_MODE_LOGOUT_AUTHENTICATED_USER = True

When activating the maintenance mode also the superuser gets logged out and has no change to sign-in again. With this combination I wish the superuser can stay in and all authenticated users get logged off?

I would even do the check later and provide the user with the login screen. If not a superuser login will fail with 503, but a superuser can login.

williwacker avatar Apr 30 '24 16:04 williwacker

@williwacker these two settings operates in different contexts: MAINTENANCE_MODE_IGNORE_SUPERUSER tells if super user is subject to maintenance mode response or not, MAINTENANCE_MODE_LOGOUT_AUTHENTICATED_USER affects all users.

For achieving what you need some new options should be added:

  • MAINTENANCE_MODE_LOGOUT_STAFF_USER
  • MAINTENANCE_MODE_LOGOUT_SUPERUSER

fabiocaccamo avatar Apr 30 '24 16:04 fabiocaccamo

Sounds good.

williwacker avatar Apr 30 '24 16:04 williwacker