mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Ajax requests not properly returning 403
When an AJAX request is made to a page that's not authorized, an infinite redirect loop to /status:403/exit:1 is triggered. This bug has existed at least since CakePHP v2.3.0. The main use case is when a user's session has expired and they try to use an authenticated feature as a logged-out user.
This commit is contained in:
parent
0d0d1e15f9
commit
1922a18d07
1 changed files with 3 additions and 1 deletions
|
@ -373,7 +373,9 @@ class AuthComponent extends Component {
|
|||
$this->_stop();
|
||||
return false;
|
||||
}
|
||||
$controller->redirect(null, 403);
|
||||
$controller->response->statusCode(403);
|
||||
$controller->response->send();
|
||||
$this->_stop();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue