Hi there,
I have posted on another group, but had no replies, so please forgive
me if this is a double up.
I am still fairly new at cake and have been trying, very
unsuccessfully to setup a login to some admin tools on a site I have
built using Cake 2.
I have now tried about 4 different methods for implementing the Auth
component and every time I add the Auth component to my AppController,
I get a redirect loop error.
Even if I go to a supposedly "allowed" page, this happens. I have just
finished doing a tutorial on yet another Auth implementation and have
setup the tutorials app fine and it works perfectly. But the minute I
port this across to my app, it gives me the redirect loop error.
Since I have now tried this with 4 different Auth implementations, my
assumption is that the issue is not in the Auth implementation code,
but in my origional Cake app. But, I cannot fathom where to start
looking and what exactly I am looking for.
I am pasting the current AppController Auth code below. The problem
appears to happen when the redirect to users/login happens. I have
tried turning redirect off with autoRedirect = false. I have tried
changing where the redirect should go as well. none seems to work.
Any ideas on where the problem might lie would be much appreciated.
Here's the code for the AppController:
<?php
class AppController extends Controller {
public $components = array(
'Session',
'Auth'=>array(
'loginRedirect'=>array('controller'=>'users',
'action'=>'index'),
'logoutRedirect'=>array('controller'=>'users',
'action'=>'index'),
'authError'=>"You can't access that page",
'authorize'=>array('Controller')
)
);
public function isAuthorized($user) {
return true;
}
public function beforeFilter() {
$this->Auth->allow('index', 'view');
$this->set('logged_in', $this->Auth->loggedIn());
$this->set('current_user', $this->Auth->user());
}
}
?>
Thanks in advance,
Nikki
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php