auth component issue
- by madphp
Im trying to get my admin routing working with the auth component. I want the following routing to work.
Router::connect('/admin', array('controller' => 'pages', 'action' => 'index', 'admin' => true));
but when i type in /admin it redirects to /admin/users/login and display this error.
Create UsersController::admin_login() in file: cms.local/controllers/users_controller.php
here is my app_controller code.
class AppController extends Controller {
    var $components = array('DebugKit.Toolbar','Auth','Session');
    function beforeFilter(){
        //Set up Auth Component
        $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
        $this->Auth->loginRedirect = array('controller' => 'pages', 'action' => 'admin_index');
        $this->Auth->allow('display');
    }
}
users_controller
<?php
class UsersController extends AppController {
    var $name = 'Users';
    function login(){
    }
    function admin_logout(){
        $this->Session->destroy();
        $this->redirect($this->Auth->logout());
    }
}
?>
If you require more information let me know.
Thanks