From 606dd7f4ce310d4654f1af43dfb279378aa6c16e Mon Sep 17 00:00:00 2001 From: Matthew Oliveira Date: Wed, 13 Dec 2017 15:59:26 -0500 Subject: [PATCH 1/3] #446 Check for session first before logging out in fastLogout method of DrupalAuthenticationManager --- .../Manager/DrupalAuthenticationManager.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Drupal/DrupalExtension/Manager/DrupalAuthenticationManager.php b/src/Drupal/DrupalExtension/Manager/DrupalAuthenticationManager.php index a6207eaf..49fede77 100644 --- a/src/Drupal/DrupalExtension/Manager/DrupalAuthenticationManager.php +++ b/src/Drupal/DrupalExtension/Manager/DrupalAuthenticationManager.php @@ -130,7 +130,10 @@ public function loggedIn() */ public function fastLogout() { - $this->getSession()->reset(); - $this->userManager->setCurrentUser(false); + $session = $this->getSession(); + if ($session->isStarted()) { + $session->reset(); + $this->userManager->setCurrentUser(FALSE); + } } } From d49a3da08786261b4e72c825dce4d931b69c7437 Mon Sep 17 00:00:00 2001 From: Matthew Oliveira Date: Wed, 13 Dec 2017 16:12:32 -0500 Subject: [PATCH 2/3] #446 Fix coding standards warnings. --- .../DrupalExtension/Manager/DrupalAuthenticationManager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Drupal/DrupalExtension/Manager/DrupalAuthenticationManager.php b/src/Drupal/DrupalExtension/Manager/DrupalAuthenticationManager.php index 49fede77..d9c21b10 100644 --- a/src/Drupal/DrupalExtension/Manager/DrupalAuthenticationManager.php +++ b/src/Drupal/DrupalExtension/Manager/DrupalAuthenticationManager.php @@ -132,8 +132,8 @@ public function fastLogout() { $session = $this->getSession(); if ($session->isStarted()) { - $session->reset(); - $this->userManager->setCurrentUser(FALSE); + $session->reset(); + $this->userManager->setCurrentUser(false); } } } From e1252368244299c3e0b96747ccbdb5fea2002c76 Mon Sep 17 00:00:00 2001 From: Matthew Oliveira Date: Wed, 13 Dec 2017 20:43:51 -0500 Subject: [PATCH 3/3] #446 Unset the user outside the conditional. --- .../DrupalExtension/Manager/DrupalAuthenticationManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Drupal/DrupalExtension/Manager/DrupalAuthenticationManager.php b/src/Drupal/DrupalExtension/Manager/DrupalAuthenticationManager.php index d9c21b10..9f9f98b1 100644 --- a/src/Drupal/DrupalExtension/Manager/DrupalAuthenticationManager.php +++ b/src/Drupal/DrupalExtension/Manager/DrupalAuthenticationManager.php @@ -133,7 +133,7 @@ public function fastLogout() $session = $this->getSession(); if ($session->isStarted()) { $session->reset(); - $this->userManager->setCurrentUser(false); } + $this->userManager->setCurrentUser(false); } }