Giter VIP home page Giter VIP logo

auth's Introduction

Auth

  • lab
  • 3 parts
    • identification
    • session
    • interaction
  • architecture
    • signin, login routes (interaction from identification to session)
    • verify route (interaction to check session)
    • ensureAuth middleware (interaction to check session)
    • hash password with bcrypt with virtual (identification)
    • check email and password with bcrypt, authenticate instance method (identification)
    • create auth token with jwt (session)
    • findByToken static method
  • bcrypt experimentation
    • parts of hash (version, salt, hash)
    • why?
      • clear password text (anyone can steal)
      • basic hash without salt (rainbow table)
      • hash with salt (rainbow table once hash stolen, create user all users with same hash have same password)
      • hash with random salt (brute force)
      • slower is better
  • jwt experimentation
  • steps [x] hash password with virtual (in User model) [x] create auth token with jwt (in User model) [x] signup route (in auth routes) [x] authorize method (in User model) [x] login route (in auth routes) [x] findByToken method (in User model) [x] ensureAuth middleware (cookie-parser) (in ensure-auth middleware) [x] verify route (in auth routes)

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.