Fix incorrect value being stored in Auth.redirect.

An incorrect value would be stored in Auth.redirect when
a custom route with the `pass` key set.

Fixes #2366
This commit is contained in:
mark_story 2011-12-15 22:56:39 -05:00
parent 4ed2185876
commit 321caf6db6

View file

@ -314,7 +314,7 @@ class AuthComponent extends Component {
if (!$this->_getUser()) {
if (!$request->is('ajax')) {
$this->flash($this->authError);
$this->Session->write('Auth.redirect', Router::reverse($request));
$this->Session->write('Auth.redirect', $request->here());
$controller->redirect($loginAction);
return false;
} elseif (!empty($this->ajaxLogin)) {