I am trying to create my first authentication system, and I’m following this tutorial
I have everything completed, but I don’t understand how to add more users. In the database phpMyAdmin, the tutorial inserts a new user the the “accounts” table using the SQL line:
INSERT INTO `accounts` (`id`, `username`, `password`, `email`) VALUES (1, 'test', '$2y$10$SfhYIDtn.iOuCW7zfoFLuuZHX6lja4lF4XA4JqNmpiH/.P3zB8JCa', '[email protected]');
They say the password in this case is ‘test’, but how would they know that from the hashed value? I apologize if I’m missing something obvious, just a lot to learn for a beginner, and I would love some help understanding 1) how they know the specified hash value is “test” and 2) how I insert more users to my table with hashed passwords.
Thank you so much!
I’ve tried reaching out to the author, as well as researching the specific database, but still not having luck unfortunately.
Rachel May is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
7