Ticket #555 (closed Bug: fixed)

Opened 7 months ago

Last modified 7 months ago

Auth, missing auto_login method

Reported by: alexsancho Owned by: Shadowhand
Priority: major Milestone: 2.2
Component: Modules:Auth Version: SVN HEAD
Keywords: Cc:

Description

New Auth module fails to auto_login, seems that this method just doesn't exists

        public function auto_login()
        {
                if ($token = cookie::get('authautologin')) 
                {
                        // Load the token and user 
                        $token = new User_Token_Model($token);
                        $user = new User_Model($token->user_id);

                        if ($token->id > 0 AND $user->id > 0) 
                        {
                                if ($token->user_agent === sha1(Kohana::$user_agent)) 
                                {
                                        // Save the token to create a new unique token
                                        $token->save();

                                        // Set the new token
                                        cookie::set('authautologin', $token->token, $token->expires - time());

                                        // Complete the login with the found data
                                        $this->complete_login($user);

                                        // Automatic login was successful
                                        return TRUE;
                                }

                                // Token is invalid
                                $token->delete();
                        }
                }

                return FALSE;
        }

Change History

Changed 7 months ago by Shadowhand

  • status changed from new to assigned
  • svn_rev set to 2471

Changed 7 months ago by Shadowhand

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in r2482.

Note: See TracTickets for help on using tickets.