diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php index 3381d68f1..1b65fd921 100644 --- a/lib/Cake/Controller/Component/AuthComponent.php +++ b/lib/Cake/Controller/Component/AuthComponent.php @@ -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);