Git Product home page Git Product logo

login_required_lab-seattle-web-082619's Introduction

Login Required Lab

Objectives

We're going to make a Rails app that requires you to be logged in to see one of its pages.

Introduction

Our app has three pages:

  1. A login page, where the user enters their username. No passwords; we'll just trust them. After they're logged in, users are taken to...
  2. A user homepage, which says, "Hi, #{username}", and has a link to the secret page, which is...
  3. A page with a secret on it, which users must be logged in to see.

Instructions

  1. Build out the SessionsController.

  2. Write a current_user method.

  3. Write a SecretsController using a before_action to prevent any route from being accessed without logging in.

Use the specs as your guide, but we'd like the following behavior. We should be able to:

  • Visit the root of the app and be redirected to a login page.
  • If a user fails to enter their name on the login page, they should be redirected there until they successfully do so.
  • Once logged in, a user should see the welcome page. This page should greet the user and link them to the secret page.
  • The content and URL of the secret page are up to you. However, if we visit that URL without logging in, we should be redirected to the login page. Under no circumstances should we allow people who are not logged in to see the secrets.

Happy coding!

View Login Required Lab on Learn.co and start learning to code for free.

login_required_lab-seattle-web-082619's People

Contributors

queerviolet avatar maxwellbenton avatar annjohn avatar blake41 avatar aviflombaum avatar pletcher avatar ahimmelstoss avatar lkwlala avatar victhevenot avatar danielseehausen avatar genericlady avatar

Watchers

James Cloos avatar Kevin McAlear avatar  avatar Mohawk Greene avatar  avatar Belinda Black avatar Bernard Mordan avatar raza jafri avatar  avatar Joe Cardarelli avatar The Learn Team avatar Sophie DeBenedetto avatar  avatar  avatar Matt avatar Antoin avatar Alex Griffith avatar  avatar Amanda D'Avria avatar  avatar Nicole Kroese  avatar Kaeland Chatman avatar Lisa Jiang avatar Vicki Aubin avatar  avatar  avatar  avatar

Forkers

brianly27

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.