Auth hashes password fields automatically, so it's being hashed twice here.
On Thu, Oct 7, 2010 at 12:31 PM, a17s <[email protected]> wrote: > I am trying to register and authenticate users using the Auth > component in CakePHP but keep getting a failed login attempt even with > the right credentials. Please see below my register and login function > > var $components = array('Auth'); > ... > function register(){ > if(!empty($this->data)){ > $this->data['User']['password'] = > $this->Auth->password($this- >>data['User']['password']); > $this->User->create($this->data); > if($this->User->save($this->data)){ > $this->Session->setFlash('Congratulations, > your account has been > successfully created. Password: '.$this->data['User'] > ['password']); > $this->redirect(array('controller'=>'users', > 'action'=>'index')); > } > else{ > //unable to save data > $this->Session->setFlash(__('Unable to > register user, please try > again')); > } > } > } > > function login(){ > > } > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > 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 > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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
