i have this login method its right now getting password from db in md5, but i want it to recognize bcrypt hash from db and then login, i am using CI framework
This is my login controller
public function login()
{
$this->form_validation->set_rules(‘username’, ‘’.$this->lang->line(“email”).’’, ‘trim|required|valid_email’);
$this->form_validation->set_rules(‘password’, ‘’.$this->lang->line(“password”).’’, ‘trim|required’);
if ($this->form_validation->run() == false)
$this->login_page();
else
{
$this->csrf_token_check();
$username = strip_tags($this->input->post('username', true));
$password = md5($this->input->post('password', true));
if ($this->session->userdata('logged_in') == 1 && $this->session->userdata('user_type') == 'Admin')
{
redirect('dashboard', 'location');
}
if ($this->session->userdata('logged_in') == 1 && $this->session->userdata('user_type') == 'Member')
{
redirect('dashboard', 'location');
}
}
}
}
And i think it is getting password hash from “system/core/compat/hash”