Summary
In this chapter, we understood the logic behind login and signup pages and learned a very solid way of implementing and managing accounts according to the best practices summarized here.
When users sign up on our web apps, they provide a username and a password. The username serves as their unique identifier, while the password is a secret known only to them. For security, these credentials are stored in a database, but the passwords are not kept as plain text. Instead, they are converted into a hash, a one-way function that is easy to compute from a password but hard to reverse. This ensures that even if a hacker accesses the database, they can’t easily decipher the passwords.
During login, the user’s entered password is hashed and compared with the stored hash; if they match, the user is granted access. Storing these hashes is crucial for allowing users to log in and recover passwords. Although hacking these hashes is possible, it is much more difficult...