From a5ca4ecb596cc5b0d7c706e849a864153854d60f Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Tue, 18 Jul 2017 17:15:58 +1200 Subject: [PATCH] FIX Log in as someone else returns user back to login screen --- src/Security/MemberAuthenticator/LogoutHandler.php | 2 +- tests/behat/features/login.feature | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Security/MemberAuthenticator/LogoutHandler.php b/src/Security/MemberAuthenticator/LogoutHandler.php index bdbca9265..1bbb253da 100644 --- a/src/Security/MemberAuthenticator/LogoutHandler.php +++ b/src/Security/MemberAuthenticator/LogoutHandler.php @@ -109,6 +109,6 @@ class LogoutHandler extends RequestHandler return $this->redirect($backURL); } - return $this->redirect(Director::absoluteBaseURL()); + return $this->redirect(Security::config()->get('login_url')); } } diff --git a/tests/behat/features/login.feature b/tests/behat/features/login.feature index 29ba09d5d..e9ba96832 100644 --- a/tests/behat/features/login.feature +++ b/tests/behat/features/login.feature @@ -25,3 +25,11 @@ Feature: Log in When I press the "Log out" button And I go to "/admin/" Then I should see a log-in form + + Scenario: Log in as someone else + Given I am logged in with "ADMIN" permissions + When I go to "/Security/login" + Then the response should contain "Log in as someone else" + + When I press the "Log in as someone else" button + Then I should see a log-in form