$this->Auth->login unfortunately doesn't use "email" as one of it's fields in logging in. it instead uses "username" and "password" as its default fields.
You can see it at the implementation of the login function of Auth. http://api.cakephp.org/1.2/auth_8php-source.html#l00568 it uses $this->identify($data) and $this->identify($data) uses "username" and "password" as its field. http://api.cakephp.org/1.2/auth_8php-source.html#l00717 Maybe that's the case that its not working. On Sep 24, 1:29 am, Edi <[EMAIL PROTECTED]> wrote: > I am also having this problem. I can't make it login. > Tried several versions, with both passwords (hashed, no hashed), but > nothing. > > Currently i have this: > > $this->Auth->login(array('User'=>array('email'=>$this->data['User'] > ['email'], 'password'=>$this->data['User']['password2']))) > > but it is not working. (using 'email' for password). > > login works like a charm with cookie: > > $cookie = array(); > $cookie['email'] = > $this->data['User']['email']; > $cookie['password'] = > $this->data['User']['password']; > $this->Cookie->write('User', $cookie, > true, '+2 weeks'); > > $cookie = $this->Cookie->read('User'); > if ($cookie) > { > $this->Auth->login($cookie); > } > > On 24 ruj, 10:03, Fran Iglesias <[EMAIL PROTECTED]> wrote: > > > > > El 24/09/2008, a las 9:31, mario escribió: > > > > So in this case, > > > $this->Auth->login($this->data); //loginuser > > > I think you have the plain version of the password in password2 field. > > You could do some like: > > > if ($this->User->save($this->data)) { > > $this->data['User']['password'] = $this->data['User']['password2']; > > $this->Auth->login($this->data); //loginuser > > > } > > > -- > > Fran Iglesias > > [EMAIL PROTECTED] --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
