Re: Auth Error somewhere
Heh, sometimes I had the same issue. I tried to login but I thought I
failed although login was success. The thing is, when you login, try
to access to smth that that kind of user can and see if it is OK.
Also, in app_controller add an loginredirect which will redirect you
after successful login, and you will then know for sure that it is all
OK. After that add an redirect that if a user is logged in and tries
to access /users/login, that he is automatically redirected to another
page, so that there is no confusion :)
I hope that this is it :) It took me hours :)
On Mar 19, 4:37 pm, "Krissy Masters" <naked.cake.ba...@gmail.com>
wrote:
> For some reason I can not login.
>
> New site 1.3.6 add user success, db password field hashed Go login error
> password or username and I can not figure out why. Done all this many times
> before and now stuck on something so trivial I cant even think where to look
> other than the obvious.
>
> Stripped everything out of my functions to bare bones and same thing.
>
> I have my libs folder where sites share 1 core cake directory and everything
> else is fine so hmm..
>
> Cleared cache local, server tmp files.
>
> Controllers:
>
> public function beforeFilter() {
> parent::beforeFilter();
> $this->Auth->allowedActions = array('*');
> $this->Auth->autoRedirect = false;
>
> }
>
> App_controller
>
> public function beforeFilter() {
> $this->Auth->allow('display');
> $this->Auth->authorize = 'controller';
> $this->Auth->loginAction = array( 'admin' => false, 'controller' =>
> 'users', 'action' => 'login');
> $this->Auth->logoutRedirect = array('controller' => 'pages',
> 'display' => 'index');
> $this->Auth->loginRedirect = array('controller' => 'users', 'action'
> => 'index', 'admin' => true);
> $this->Auth->loginError = "Invalid E-mail or Password.";
> $this->Auth->authError = "Restriced.";
> $this->Auth->ajaxLogin = '/elements/users/expired_login';
>
> }
>
> public function isAuthorized() {
>
> return true;
> }
>
> Users_controller
>
> public function beforeFilter() {
> parent::beforeFilter();
> $this->Auth->allowedActions = array('*');
> $this->Auth->fields = array('username' => 'email', 'password' =>
> 'password');// db fields hashed saved just fine
> $this->Auth->autoRedirect = false;
>
> }
>
> public function login() {
>
> if ($this->Session->read('Auth.User')) {
> $this->Session->setFlash(__( 'You are
> already logged in. ', true ), 'default', array( 'class' => 'flash_fail' ) );
> $this->redirect( array( 'controller' =>
> 'pages', 'action' => 'display', 'about' ) );
> }
> }
>
> What am I missing? Gone wrong forgot what?
>
> Thanks all
>
> K
--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home