Giter VIP home page Giter VIP logo

authentication-deliverable's Introduction

Authentication practice

Your mission is to build the exact same app we did today in class. In case of emergency, a sample solution can be found here: https://github.com/SEI-SEA-1-25/intro-to-authentication-soln. Your app should have the following user stories:

Core goals

  1. Links to Log In and Sign Up are in the nav bar.
  2. The Sign Up link takes me to a registration form with email and password fields.
  3. When I submit the registration form, a user is created in the db, and the userId cookie is set to that user's id.
  4. The Log In link takes me to a login form, also with email and password fields.
  5. When I submit the login form, the server looks up the user with the inputted email, then compares the looked-up-user's password to the inputted password. If they match, the userId cookie is set to that user's id, and I'm redirected to the home page. If they don't match, re-render the login form.
  6. On every request, look up a user from the db using the userId cookie. Attach this user to res.locals.user.
  7. When no user is logged in, the nav bar remains Sign Up & Log In. When a user is signed in, the nav bar changes to Profile & Log Out.
  8. When Log Out is clicked, the userId cookie is cleared and I get redirected to the home page.
  9. When Profile is clicked, I see a page that says "Hello {email of the logged in user}!".

Stretch goals

  1. When a user signs up or logs in, before setting the userId cookie, encrypt it with a secret string. The secret string should be stored in a .env file.
  2. When looking up the current user on every request, decrypt the incoming userId cookie using the same secret string.
  3. When creating a user, before saving them to the db, hash their password and save the hash, not the plaintext.
  4. When logging in a user, hash the password they are attempting to log in with before comparing it to the hashed password stored in the db.

authentication-deliverable's People

Contributors

pmacaluso3 avatar chrisdavidspicer 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.