On Thu, Apr 5, 2012 at 09:53, Michael Gaiser <mjgai...@gmail.com> wrote: > So, I have a login link in the corner of my homepage which I want people to > click on to login... pretty simple. Problem is that I cannot seem to view my > homepage as I am automatically redirected to the login page. This causes > issues when you login since the login returns you to the initial page (the > home page) which then transfers you back to the login etc. Inf loop time. So > I cannot seem to figure out why it is automatically redirecting my homepage > to the login page. Thanks. > > > app_controller: > > function beforeFilter() { > $cookie = null; > > //debug($this->Auth); > > // Change the default field names for the username and password > $this->Auth->fields = array('username' => 'username', 'password' => > 'passwd'); > > //Set application wide actions which do not require authentication > //$this->Auth->allow(array('*')); > $this->Auth->allow('/', 'login', 'logout', 'confirm'); >
You should move $this->Auth->allow into the specific controller for that action, I think. For example, in the users controller for the login and logout actions. So that means that wherever you have set your / route in routes.php should have its own Auth->allow line to allow the action. Does that make sense or have I confused it? Don't forget to call parent::beforeFilter(); in the beforeFilter function in your controller so that the appController one still gets called. Mike. -- 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 cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php