Reputation: 2178
I am getting a redirect loop error and for the life of me I can't figure out how or why. Here are my settings:
Router
Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
AppController
class AppController extends Controller {
public $components = array(
'DebugKit.Toolbar',
'Acl',
'Auth' => array(
'authorize' => array('Actions' => array('actionPath' => 'controllers')),
'loginAction' => array('controller' => 'users', 'action' => 'login'),
'loginRedirect' => array('controller' => 'users', 'action' => 'index'),
'logoutRedirect' => array('controller' => 'pages', 'action' => 'display', 'home')
),
'Session'
);
var $helpers = array('Html', 'Form', 'Session');
public function isAuthorized($user){
return true;
}
function beforeFilter() {
}
}
Upvotes: 2
Views: 3217
Reputation: 5464
This may be of because you did not set the display() method as public. That's why it may redirecting to the same page and that webpage is not authenticated.
So you can put you "display() method" in your pages controller a public accessible using the following code:
//Define following method in your controller PagesController.php
function beforeFilter()
{
$this->Auth->allow('display');
}
Hope it will work for you. Please ask if not worked for you.
Upvotes: 2