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