Congratulations! You built an authentication system from scratch. What can we generalize so far?
- An authentication system is made up of sign up, log in, log out functionality.
has_secure_passwordmethod are provided by bcrypt to store passwords securely.
- A session begins when a users logs in, and ends when a user logs out.
current_usermethod allow us to access the current user;
require_userredirects to the root of the app if there is no such user.
- Before actions act as filters. They call methods before executing controller actions.
Sign up to start coding