try not putting anything in the login action. It does what you are
trying to do automatically. You also don't need to redirect to the
referrer as the Auth component stores this automatically. The Auth
component also looks for logout in a new action logout. Thats where to
put your redirect.
Also make sure the password you stored in your database is the hashed
version. You can view a hash result by putting echo $this->Auth-
>password("password string here"); in an action.
On Dec 7, 2008, at 6:15 PM, gearvOsh wrote:
>
> So im trying to get the Auth component to work, here is my
> AppController.
>
> function beforeFilter() {
> // Referer
> $referer = $this->referer(null, true);
> if (empty($referer)) {
> $referer = array('controller' => 'dashboard', 'action' => 'index');
> }
>
> // Authenticate
> if (isset($this->Auth)) {
> $this->Auth->sessionKey = 'User';
> //$this->Auth->authorize = 'controller';
> $this->Auth->loginAction = array('controller' => 'users', 'action' =>
> 'login');
> $this->Auth->loginRedirect = $referer;
> $this->Auth->logoutRedirect = array('controller' => 'site', 'action'
> => 'index', 'home');
> }
> }
>
> That all works fine, its just when I submit my login form (users/
> login), the password field does not get encrypted, so it never finds
> any rows. I read the docs and it said that it should auto-encrypt any
> field named password, obviously its not.
>
> Login action:
>
> // Form processing
> if (!empty($this->data)) {
> $this->Auth->login($this->data['Form']);
> }
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---