Authentication

Together, signing up, logging in and logging out make up an authentication system.

Start[missing "en.views.course_landing_page.rails-auth.course_illustration" translation]
Authentication
Lesson 1 of 1
  1. 1

    Many web apps let users sign up for a new account and log in and out of their accounts. Together, signing up, logging in and logging out make up an authentication system. Let's create an authentic...

  2. 2

    Using the request/response cycle as a guide, here's how authentication fits in: Turn one: 1. When a user visits the signup page, the browser makes an HTTP GET request for the URL [...] . 2...

  3. 3

    What did we just do? 1. We created a model named User. 2. In the model, we used the method [...] . This method adds functionality to save passwords securely. 3. In order to save passwords securel...

  4. 4

    Nice work! You've added columns to the users table and ran a migration to update the database. What's the [...] column for? When a user submits her password, it's not a good idea to store that p...

  5. 5

    Great! When you visit the URL [...] , the browser makes a GET request for the URL. This request hits the Users controller's [...] action, which returns a view displaying the signup page.

  6. 6

    Nice job! Now when you fill in the signup form and submit it, the data is sent to the Rails app via a POST request. The request hits the User controller's [...] action. The [...] action saves t...

  7. 7

    Now that users can sign up for a new account, let's add the ability to log in and log out of the app. Using the request/response cycle as a guide again, here's how logging in and logging out fits i...

  8. 8

    Well done! 1. When you visit the URL [...] , the browser makes a GET request for the URL. This request hits the Sessions controller's [...] action, which returns a view displaying the login pa...

  9. 9

    Nice job! Now when you fill in the login form and submit it, the data is sent to the Rails app via a POST request. The request hits the Sessions controller's [...] action. The [...] action chec...

  10. 10

    Great work so far! We've built an authentication system that lets new users sign up for the site, and lets existing users log in and out. However, there's one problem - even after you log out, you...

  11. 11

    How do these methods work? 1. The [...] method determines whether a user is logged in or logged out. It does this by checking whether there's a user in the database with a given session id. If t...

  12. 12

    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. The [...] colu...

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo

Authentication

Start[missing "en.views.course_landing_page.rails-auth.course_illustration" translation]