cakephp - Multiple Routing Prefixes + loginAction Not Working -
i have searched , though people have asked similar if not exact same question on site , elsewhere, several of questions have gone unanswered , rest don't apply me (different error, old cake version, etc).
i have 2 routing prefixes set in core.php. 'admin' , 'moderate'. want users login via /users/login , redirected afterwards /account.
when go standard (non-prefixed) page requires authentication such /account, redirected /admin/users/login (i not want prefix).
after login redirected /account. (at least part working)
here appcontroller code
public $components = array('session', 'auth' => array( 'loginaction' => array('prefix' => false, 'admin' => false, 'moderate' => false, 'controller' => 'users', 'action' => 'login'), 'loginredirect' => array('prefix' => false, 'admin' => false, 'moderate' => false, 'controller' => 'account', 'action' => 'index'), 'logoutredirect' => array('controller' => 'index', 'prefix' => false, 'admin' => false, 'moderate' => false), 'autherror' => "you can't access page", 'authorize' => array('controller') ) ); // components i tried changing 'false' 'null'. no dice. i'm using cakephp 2.2.4
edit of 2/11/14 because people still answering wanted note question resolved. never figured out exact issue never posted official/accepted answer. suspect issue routing. appcontroller code provided above correct.
try using this:
$this->auth->loginaction = '/users/login'; hopes help!
Comments
Post a Comment