Wednesday, October 23, 2013

Re: CakePHP 2.3.9 - Problems with Authentication

Are you encrypting the password when you save the users?

if not try to add this to your user's model:

public function beforeSave($options = array()) {
if (isset($this->data[$this->alias]['password'])) {
$this->data[$this->alias]['password'] = AuthComponent::password($this->data[$this->alias]['password']);
}
return true;
}

Regards

Roly

On Wednesday, 23 October 2013 04:27:13 UTC+11, Henrique Droog wrote:
Hello! I'm brazilian, sorry for my bad english.

I'm using CakePHP 2.3.9, i can find results, save, update and delete, but when i'm trying to authenticate with Auth, i always receive the same message. "Username and password is not valid", but i'm insert the user correctly. I'm using the cakephp documentation. http://book.cakephp.org/2.0/pt/tutorials-and-examples/blog-auth-example/auth.html.

Thank's.
Henrique

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: