'codeigniter 4 password_verify can not works
I am using password_hash function to store password in table it works but can not give result after password_verify what is mistake done my me.
'password'=>password_hash($this->request->getPost('password'), PASSWORD_DEFAULT),
$users=new UsersModel();
$email=$this->request->getPost('email');
$password=$this->request->getPost('password');
$result=$users->where('email',$email)->first();
$get_password=$result['password'];
if(!password_verify($password,$get_password))
{
return redirect()->to(base_url('admin/login'))->with('failed','Password is not matched');
}
else
{
$user_id=$result['id'];
session()->set('loguser',$user_id);
return redirect()->to(base_url('/admin'));
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
