Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
markstory committed Dec 16, 2011
1 parent 4ed2185 commit 321caf6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Controller/Component/AuthComponent.php
Expand Up @@ -314,7 +314,7 @@ public function startup($controller) {
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());

This comment has been minimized.

Copy link
@ADmad

ADmad Dec 16, 2011

Member

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.

This comment has been minimized.

Copy link
@markstory

markstory Dec 16, 2011

Author Member

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

This comment has been minimized.

Copy link
@ADmad

ADmad Dec 16, 2011

Member

Ignore my comment in that case :)

$controller->redirect($loginAction);
return false;
} elseif (!empty($this->ajaxLogin)) {
Expand Down

0 comments on commit 321caf6

Please sign in to comment.