From e857032a7300994bf2d456ea195ba22bb8fae122 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Fri, 2 May 2014 22:19:08 +0200 Subject: [PATCH] Made logout redirect to last visted page --- src/Controllers/AuthController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Controllers/AuthController.php b/src/Controllers/AuthController.php index 6e624c96..35f2e9dd 100644 --- a/src/Controllers/AuthController.php +++ b/src/Controllers/AuthController.php @@ -8,7 +8,7 @@ class AuthController //check if already logged in if (Auth::isLoggedIn()) - self::redirectAfterLog(); + self::redirect(); } public function loginAction() @@ -17,13 +17,13 @@ class AuthController $suppliedPassword = InputHelper::get('password'); $remember = boolval(InputHelper::get('remember')); Auth::login($suppliedName, $suppliedPassword, $remember); - self::redirectAfterLog(); + self::redirect(); } public function logoutAction() { Auth::logout(); - \Chibi\Util\Url::forward(\Chibi\Router::linkTo(['IndexController', 'indexAction'])); + self::redirect(); } public static function observeWorkFinish() @@ -38,7 +38,7 @@ class AuthController $_SESSION['login-redirect-url'] = $context->query; } - private static function redirectAfterLog() + private static function redirect() { if (isset($_SESSION['login-redirect-url'])) {