![]() |
Why Does CodeIgniter Shield Hash Passwords After User Data Insertion? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Why Does CodeIgniter Shield Hash Passwords After User Data Insertion? (/showthread.php?tid=90902) |
Why Does CodeIgniter Shield Hash Passwords After User Data Insertion? - tarcisiodev1 - 05-20-2024 Hi everyone! I'm studying the CodeIgniter Shield code and noticed that the password hash seems to be done after inserting the user's data into the database. Could someone confirm if this is correct and explain why this approach was chosen?Here is a part of the UserModel and User entity code showing this:UserModel.php UserModel.php PHP Code: protected $afterInsert = ['saveEmailIdentity']; User.php PHP Code: public function saveEmailIdentity(): bool Why is the password hashed after insertion and not before? |