That would be one option.

Here is my signup code:

        function signup()
        {
                if (!empty($this->data)) {
                        if(isset($this->data['User']['password2']))
                        {
                        $password2hashed = $this->Auth->password($this-
>data['User']['password2']);
                                if($password2hashed == 
$this->data['User']['password'])
                                {
                                        $this->User->create();
                                        if ($this->User->save($this->data)) {
                                                
$this->Auth->login($this->data); // login user
                                        } else {
                                        $this->Session->setFlash('There was an 
error signing
up. Please, try again.');
                                        $this->data = null;
                                        }
                                }
                                else
                                {
                        $this->Session->setFlash('Different password re-
entered.');
                                        $this->data = null;
                                }
                        }
                }
        }

This time, it failed to login the user. It seems like there is some
problem in terms of hashing my password.
Did I missed something here?


On Sep 24, 2:31 pm, Fran Iglesias <[EMAIL PROTECTED]> wrote:
> El 24/09/2008, a las 7:28, mario escribió:
>
> > Do anyone of you have an idea on how to automatically login
> > after signing-up using Auth Component?
>
> This seems a task for $this->Auth->login()
>
> http://api.cakephp.org/1.2/class_auth_component.html#5c2562e36d1fb6f8...
>
> --
> 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 cake-php@googlegroups.com
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