mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Issue #9040 - Auth saving json in Auth.redirect
AuthComponent is storing JSON or any other AJAX request URL into the session variable Auth.redirect used for login redirect if the AJAX request does not send the X-Requested-With:XMLHttpRequest header. If you send an ajax request without that header and your request is not a (.json) it will store the URL anyway.
This commit is contained in:
parent
92a50d05dc
commit
2c112095a9
1 changed files with 1 additions and 1 deletions
|
@ -359,7 +359,7 @@ class AuthComponent extends Component {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (!$controller->request->is('ajax')) {
|
||||
if (!$controller->request->is('ajax') && !$controller->request->is('json')) {
|
||||
$this->flash($this->authError);
|
||||
$this->Session->write('Auth.redirect', $controller->request->here(false));
|
||||
$controller->redirect($this->loginAction);
|
||||
|
|
Loading…
Add table
Reference in a new issue