php - login password verify codeigniter 4

one text

Solution:

the problem isn't with your code. THE PROBLEM IS MOST LIKELY THE PASSWORD FORMAT IN YOUR DATABASE STRUCTURE. If you have your password format set to VARCHAR 50 or (which means; a variable character with a maximum length of 50), YOU WOULD NEED TO CHANGE THE LENGHT TO 80 OR 100 TO BE SAFE.

The reason for the above is that the Hash function in Code Igniter-4 tends to encrypt/convert characters into lengths greater than 50. So if the password format length is set to 50, the Database is forced to truncate/shorten the encrypted characters when they're getting saved into the Database which then creates a problem when you're trying to decrypt the password when using the Check or Password_Verify functions, because the complete length characters are no longer available for decryption.

Source