Can't validate password_hash generated in console in front-end
Can't validate password_hash generated in console in front-end
I do generatePasswordHash
from console to create a user. And when user is created, I can't login. I try to validatePassword
but useless - always returns false. But when I do the same generatePasswordHash
in front-end part it returns true.
Is there any difference between validation or generating hash from console and front-end?
generatePasswordHash
validatePassword
generatePasswordHash
Are you sure that you're using the same PHP version in console and web app?
– rob006
Jul 1 at 12:08
It can be different even for same PHP version, if
mods_available
are different for cli and web– Andriy Maletsky
Jul 1 at 14:02
mods_available
Can you show the code?
– FeR-S
yesterday
Thanks everyone. I was wrong. I was parsing csv file and used wrong string to create password. Not actually wrong, the password string I used was like this:
"password"n
, so in the end there was even new line...– khandaniel
yesterday
"password"n
1 Answer
1
What I finally understood is that password hash generated in console can be validated in frontend. That was only my mistake. Hope this helps to someone.)
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
There should be the same process for both. It must be something else you are doing. It would help if you paste the code for creating user in console app.
– Bizley
Jul 1 at 9:36