0

I am passing the correct email and password in the login form. The Code gets the right hashed password from the Database. The function password_verify() returns nothing. Neither true or false. Did I do anything wrong there?

//Login User
    public function login($email, $password){
        $this->db->query('SELECT * FROM users WHERE email = :email');
        $this->db->bind(':email', $email);


        $row = $this->db->single();

        $hashed_password = $row->password;
        $var_dump = password_verify($password, $hashed_password);
        echo $var_dump;

        if($var_dump){
            return $row;
        }else {
            return false;
        }
    }

I am hashing the password in a register function:

//Hash Password
   $data['password'] = password_hash($data['password'], PASSWORD_DEFAULT);

Thanks for your help!

Alex
  • 1

0 Answers0