[Solved] Cannot login with model my login function |
I am using password password_verify for my password to check if correct.
How ever I am entering the correct password but it keeps on returning false when submit form. And it is getting the secured_password from database OK. I am not sure why it keeps on returning false any suggestions? PHP Code: <?php Controller PHP Code: <?php Update: I have been trying to figure it out for some reason it does not like when I try to get my password from my database but when I hard code password in it works fine I think its some thing to do with model function any ideas? PHP Code: $username = $this->input->post('username'); PHP Code: public function secure_password($username) {
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
Hello..
Is the value return by the secure_password() function is a hash password using php's password_hash() function?
Try the below and see if it works, the hash needs to be within single quotes ''
PHP Code: public function secure_password($username) What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(07-19-2016, 04:43 PM)InsiteFX Wrote: Try the below and see if it works, the hash needs to be within single quotes '' I have found the issue. When the password has was inserted into the database there was a extra blank space been added. I have now fixed that that was the issue. Thank you all for help
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
Yes the password_hash() method will truncate at the first null byte so you need to be very careful with that. I think this only happens with the BCRYPT.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |