User logout during maintenance mode

Created on 27 May 2019, almost 6 years ago
Updated 31 January 2023, about 2 years ago

Could someone explain why all the user without permission are logged out when the website is in maintenance mode?

MaintenanceModeSubscriber

Questions:

  • Or in other words, are there problems if you override this?
  • How can I "override" this existing event subscriber?

Other links with the same "question":

๐Ÿ› Bug report
Status

Active

Version

10.1 โœจ

Component
User systemย  โ†’

Last updated 4 days ago

Created by

๐Ÿ‡จ๐Ÿ‡ญSwitzerland handkerchief

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States edmund.dunn Olympia, WA

    Rerolled for Drupal 10.

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance prudloff Lille

    #14 creates an infinite redirect loop because $this->account->isAuthenticated() is always true now so it always sends a RedirectResponse.
    I think MaintenanceModeSubscriber serves no other purpose and could be entirely removed.

  • last update over 1 year ago
    Patch Failed to Apply
  • last update over 1 year ago
    Patch Failed to Apply
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance prudloff Lille

    Here is a reroll for Drupal 10.2.3.

  • Pipeline finished with Failed
    9 months ago
    Total: 471s
    #212987
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia samit.310@gmail.com

    samit.310@gmail.com โ†’ made their first commit to this issueโ€™s fork.

  • Pipeline finished with Success
    9 months ago
    Total: 453s
    #231235
  • Status changed to Needs review 9 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia samit.310@gmail.com

    HI,

    We have permission provided by Drupal Use the site in maintenance mode(access site in maintenance mode) that allow any user to work on maintenance mode, A simple change can fix this user logout issue,

    Here all the users who have Use the site in maintenance mode(access site in maintenance mode) permission, will not logout if the site goes to maintenance mode.

    Here is the PR link: https://git.drupalcode.org/project/drupal/-/merge_requests/8876/diffs

    Thanks
    Samit K.

  • ๐Ÿ‡จ๐Ÿ‡ญSwitzerland handkerchief

    @samit.310@gmail.com But not logging out does not automatically mean that users should continue to use the website despite maintenance.

    Example from practice:
    Website is briefly switched to maintenance mode several times a day because automatic backups are performed. However, it is correct that during backups, no user administers the website and therefore should not have the permission โ€œUse the site in maintenance modeโ€. But the users should not all be logged out just because maintenance mode was switched on briefly. If you have a website with a community where many users are logged in, then they are automatically logged out several times a day.

  • Status changed to Needs work 9 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Only briefly skimmed but any change will need test coverage.

    Also issue summary appears incomplete, recommend using default issue template. Sounds like from previous comment MR solution isn't along the idea so definitely needs a summary update.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia samit.310@gmail.com

    Hi @handkerchief,

    Agree with your point, but here the idea is the only trusted or some specific user roles have this permission Use the site in maintenance mode(access site in maintenance mode).

    The functionality will remain the same for other users, meaning whenever the maintenance mode will on all the users except those with the above permission will logout.

    Thanks
    Samit K.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States bapplejax

    Rerolling #14 for drupal 10.3.6

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance prudloff Lille
  • Pipeline finished with Failed
    26 days ago
    Total: 155s
    #447015
  • Pipeline finished with Canceled
    26 days ago
    Total: 338s
    #447018
  • Pipeline finished with Canceled
    26 days ago
    Total: 771s
    #447023
  • Pipeline finished with Success
    26 days ago
    Total: 997s
    #447027
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance prudloff Lille

    Added tests and updated issue summary.

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance prudloff Lille

    prudloff โ†’ changed the visibility of the branch 057267-user-logout-during-fix to hidden.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    So believe this would be a feature request vs an actual bug

    Not sure if this needs framework or product manager approval first but feedback appears to be addressed.

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom catch

    Did some git archaeology, this was added in #50901: User login under maintenance mode โ†’ .

    One of the reasons given then was that if you are logged in as a regular auth user, you would not be able to logout to then login again as an admin account. Do we still prevent people from logging out when maintenance mode is on? If so maybe we need to exclude that route.

    Also one small comment on the updated test coverage.

  • Pipeline finished with Success
    21 days ago
    Total: 1176s
    #450575
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance prudloff Lille

    I could indeed reproduce this with the patch: logged-in users can't logout (/user/logout returns the maintenance page).
    (A workaround is to open a new private browsing window but I see how this is a usability problem.)

    I added _maintenance_access to the logout route in order to fix this.

Production build 0.71.5 2024