Browse files

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
  • Loading branch information...
1 parent 4ed2185 commit 321caf6db6517b0b053aa8c26b5edcf498fd34f9 @markstory markstory committed Dec 16, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/Controller/Component/AuthComponent.php
@@ -314,7 +314,7 @@ public function startup($controller) {
if (!$this->_getUser()) {
if (!$request->is('ajax')) {
- $this->Session->write('Auth.redirect', Router::reverse($request));
+ $this->Session->write('Auth.redirect', $request->here());

ADmad Dec 16, 2011


Hmm, "here" includes the url base, so if the app is running in a subfolder when this session value is used for redirection the url base would be added twice I think.


markstory Dec 16, 2011


It was working on my test setup which was in a sub-dir.


ADmad Dec 16, 2011


Ignore my comment in that case :)

return false;
} elseif (!empty($this->ajaxLogin)) {

0 comments on commit 321caf6

Please sign in to comment.