Giter Club home page Giter Club logo

ls-auth's Introduction

LS-Auth

Packages

  • bcrypt-nodejs
  • jwt-simple
  • passport
  • passport-jwt
  • passport-local

Topics

  • bcrypt
  • salt
  • rainbow tables
  • never store plain-text passwords
  • JWT
  • token-based authentication
  • stateless authentication
  • JWT secret

Assignment

Clone down this project. Run npm i. Start your MongoDB server by running mongod from the command line. Implement the following routes. You will also need to create a config.js file that will house your secret.

  • [POST] /signup This route should add a new user to the users collection. After creating the user return a JWT token to the client.
  • [POST] /signin This route will receive a username and password in the request body. If the username and password combination are valid then return a JWT token.
  • [GET] /users This route will return an array of all users. Only return the users if the user provides a valid JWT token in the authentication header.
  • [POST] /blog-posts This route should create a new blog post and add it to the blogPosts collection. This route should only work if the user provides a valid JWT token.
  • [GET] /blog-posts This route should return every blogPost in an array. This route should only work if the user provides a valid JWT token.

ls-auth's People

Contributors

taithethai avatar

Watchers

 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.