From dc189ba46fc8c2f54b6f680410b9e7f85e6c9c8d Mon Sep 17 00:00:00 2001 From: Michael Francis Date: Fri, 1 Jul 2011 00:59:21 -0400 Subject: Fix to redirect a user if they request a private function while not logged in --- config/bootstrap/auth.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'config/bootstrap/auth.php') diff --git a/config/bootstrap/auth.php b/config/bootstrap/auth.php index acbc4d5..a82d63a 100644 --- a/config/bootstrap/auth.php +++ b/config/bootstrap/auth.php @@ -123,7 +123,10 @@ Dispatcher::applyFilter('_callable', function($self, $params, $chain) { return $ctrl; } - //Otherwise, send them to the login page + //Save the location they are going to + $value = array('controller' => $ctrl->request->controller, 'action' => $ctrl->request->action, 'args' => $ctrl->request->args); + Session::write('url', $value); + //Redirect them to the login page return function() use ($request) { return new Response(compact('request') + array('location' => '/login')); }; -- cgit v1.2.3