fix: [redirect on login] Fixed an issue where ajax queries would store their URL in the redirect URL field

pull/4075/head
iglocska 2019-01-30 09:14:29 +01:00
parent b45eb097c5
commit db772213f0
1 changed files with 3 additions and 1 deletions

View File

@ -333,7 +333,9 @@ class AppController extends Controller
}
} else {
if (!($this->params['controller'] === 'users' && $this->params['action'] === 'login')) {
$this->Session->write('pre_login_requested_url', $this->here);
if (!$this->request->is('ajax')) {
$this->Session->write('pre_login_requested_url', $this->here);
}
$this->redirect(array('controller' => 'users', 'action' => 'login', 'admin' => false));
}
}