Skip to content
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 15, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/Controller/Component/AuthComponent.php
2 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());
CakePHP member
ADmad added a note 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.

CakePHP member
markstory added a note Dec 16, 2011

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

CakePHP member
ADmad added a note Dec 16, 2011

Ignore my comment in that case :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
return false;
} elseif (!empty($this->ajaxLogin)) {

0 comments on commit 321caf6

Please sign in to comment.
Something went wrong with that request. Please try again.