Auth is hashing your this->data[$this->alias]['password'] field as
soon as it is submitted.
So in fact you are double hashing the field.
First, on submit, Auth hashes the field with key = 'password'
Second you manually has this using Security::hash

Try this instead - rename your field in your form to 'pwd'

Then hash the 'pwd' field into $this->data[$this->alias]['password']

See if that helps.

On May 10, 10:01 am, carlito999 <[email protected]> wrote:
> But the problem still goes on. The saved password in database is
> hashed. But they always shows 'login error' while trying to log in.
>
> On May 9, 8:51 pm, brian <[email protected]> wrote:
>
>
>
> > Auth hashes the password automatically.
>
> > On Fri, May 8, 2009 at 11:39 PM, carlito <[email protected]> wrote:
>
> > >  I m using auth component in my project.In my beforesave() function in
> > > user.php i used this to hash password.
>
> > > if(isset($this->data[$this->alias]['password']))
> > > $this->data[$this->alias]['password'] = Security::hash($this->data
> > > [$this->alias]['password'], null, true);
>
> > > But it login error still remains. I think i need to hash the password
> > > i give as input. If that's right then how to do it??

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to