if(isset($this->params['requested']))
$this->Auth->allow($this->action);
I just spent about 3 hours pulling my hair trying to figure out why my CakePHP application was stuck in an infinite redirect loop when using the built-in Auth component. The above code snippet was the simple solution.
The redirect loop is caused by elements using requestAction, so when the page loads it starts by trying to authenticate the page but then it tries to authenticate the requestAction but since it can’t authenticate the page it can’t authenticate the requestAction, hence the loop. The above code snippet when placed in your app_controller’s beforeFilter will remove the need to manually allow all your requestAction…actions.
