Welcome Guest, Not a member yet? Register   Sign In
password hashing doesn't work for all special characters
#9

OK, updated the change_password method with the new log line:

PHP Code:
protected function _change_password($password$password2$user_id$recovery_code) {
        // User ID check
        if (isset($user_id) && $user_id !== FALSE) {
            $query $this->db->select('user_id')
                    ->from($this->db_table('user_table'))
                    ->where('user_id'$user_id)
                    ->where('passwd_recovery_code'$recovery_code)
                    ->get();

            // If above query indicates a match, change the password
            if ($query->num_rows() == 1) {
                $user_data $query->row();
                
                $data 
= array(
                    'passwd' => $this->authentication->hash_passwd($password),
                            'passwd_recovery_code' => NULL,
                            'passwd_recovery_date' => NULL
                
);
                $this->db->where('user_id'$user_data->user_id)
                        ->update($this->db_table('user_table'), $data);
                log_message('debug'"\n password stored in DB       = " $data['passwd']);
                log_message('debug'"\n Password Validation       = " . (password_verify($password$data['passwd']) ? "Passed" "Failed"));
                    
            
}
        }
    

Logs show it passed:
Code:
DEBUG - 2020-08-04 20:47:33 -->
password stored in DB       = $2y$11$86rH8RbY.5BHpjq6AKZvE.SBwJoe1AwxE99M1iSPJeDzEaBufDy2S
DEBUG - 2020-08-04 20:47:33 -->
Password Validation       = Passed

DEBUG - 2020-08-04 20:47:38 -->
string     = admin
password   = 1aA'/[!@#$%^&*()\-_=+{};:,<.>§~]/'

DEBUG - 2020-08-04 20:47:39 -->
user is banned             = no
password in database       = $2y$11$86rH8RbY.5BHpjq6AKZvE.SBwJoe1AwxE99M1iSPJeDzEaBufDy2S
supplied password match    = False
required level or role     = 1
auth level in database     = 9
auth level equivalant role = admin
Reply


Messages In This Thread
RE: password hashing doesn't work for all special characters - by BilltheCat - 08-04-2020, 01:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB