Git Product home page Git Product logo

sessions_cookies_student_lesson's Introduction

Sessions, Cookies, and Auth in Rails App

Objectives

  • Explain what a session and cookie is.
  • Explain how to use sessions and cookies to login a user.
  • Demonstrate login functionality in Rails.

Warmup

  • Indiv Research/Group Share: Google what a session and cookie are

Live Code

Instructions:

  • Clone repo to your machine

  • Run rails db:{create,migrate,seed}

  • Run rails s, open config/routes.rb to test out your current functionality.

  • Build out this repo to include login functionality.

  • Complete the following user stories:

    • As an unauthenticated visitor:

      • when I visit the root page, I can see a link to the islands, but not the treasures.
      • when I visit the root page, I see an option to Sign up or Log In in the header of the page.
      • when I try to visit /treaures, I get a 404 error
      • when I visit the root page and click on Sign Up, I can fill out a form to create credentials, when I click on Submit, I am taken back to the root page as an authenticated user.
    • As an authenticated user:

      • when I visit the root page, I see links to islands and treasures.
      • when I visit the root page, I see an option to Logout in the header of the page. (Log In and Sign up are no longer showing.)
      • when I visit any page and I click Logout, I am taken back to the root page and the header options to Login or Sign Up are visible (but not Logout).

Deliverables

  • Slack DM to me: In plain english, explain to me how the login process works in Rails using bcrypt.

sessions_cookies_student_lesson's People

Contributors

kathleenscriver avatar catherine-o avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.