Loading core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -537,6 +537,8 @@ public function testRead(): void { // Test that user gets logged out when hitting non-jsonapi route. $this->drupalGet('/some/normal/route'); $this->assertFalse($this->drupalUserIsLoggedIn($this->userCanViewProfiles)); $this->assertSession()->statusCodeEquals(503); $this->assertSession()->responseContains('Site under maintenance'); $this->container->get('state')->set('system.maintenance_mode', FALSE); $this->drupalResetSession(); Loading core/modules/user/src/EventSubscriber/MaintenanceModeSubscriber.php +0 −6 Original line number Diff line number Diff line Loading @@ -5,9 +5,7 @@ use Drupal\Core\Session\AccountInterface; use Drupal\Core\Site\MaintenanceModeEvents; use Drupal\Core\Site\MaintenanceModeInterface; use Drupal\Core\Url; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpKernel\Event\RequestEvent; /** Loading Loading @@ -52,10 +50,6 @@ public function onMaintenanceModeRequest(RequestEvent $event) { // If the site is offline, log out unprivileged users. if ($this->account->isAuthenticated()) { user_logout(); // Redirect to homepage. $event->setResponse( new RedirectResponse(Url::fromRoute('<front>')->toString()) ); } } Loading Loading
core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalTest.php +2 −0 Original line number Diff line number Diff line Loading @@ -537,6 +537,8 @@ public function testRead(): void { // Test that user gets logged out when hitting non-jsonapi route. $this->drupalGet('/some/normal/route'); $this->assertFalse($this->drupalUserIsLoggedIn($this->userCanViewProfiles)); $this->assertSession()->statusCodeEquals(503); $this->assertSession()->responseContains('Site under maintenance'); $this->container->get('state')->set('system.maintenance_mode', FALSE); $this->drupalResetSession(); Loading
core/modules/user/src/EventSubscriber/MaintenanceModeSubscriber.php +0 −6 Original line number Diff line number Diff line Loading @@ -5,9 +5,7 @@ use Drupal\Core\Session\AccountInterface; use Drupal\Core\Site\MaintenanceModeEvents; use Drupal\Core\Site\MaintenanceModeInterface; use Drupal\Core\Url; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpKernel\Event\RequestEvent; /** Loading Loading @@ -52,10 +50,6 @@ public function onMaintenanceModeRequest(RequestEvent $event) { // If the site is offline, log out unprivileged users. if ($this->account->isAuthenticated()) { user_logout(); // Redirect to homepage. $event->setResponse( new RedirectResponse(Url::fromRoute('<front>')->toString()) ); } } Loading