fabiocaccamo / django-maintenance-mode

:construction: :hammer_and_wrench: shows a 503 error page when maintenance-mode is on.
MIT License
472 stars 53 forks source link

Logout all users except superusers #191

Open williwacker opened 4 months ago

williwacker commented 4 months ago

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.

Upvote & Fund

Fund with Polar

fabiocaccamo commented 4 months ago

@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:

williwacker commented 4 months ago

Sounds good.