Skip to content

Latest commit

 

History

History
36 lines (32 loc) · 948 Bytes

README.md

File metadata and controls

36 lines (32 loc) · 948 Bytes

authentication-node

A jwt based Authetication flow implemented in Nodejs.

run npm install

Then use nodemon to start up development server

Routes

  • /users/signup/
    • pass email and password in request body
    1. Creates a collection in your mongo database
    2. The password is hashed before storage
    3. A token is signed

    example :

     {
          "email" : "[email protected]",
          "password" : "password"
     }
    

    returns the token as a response

  • /users/signin/
    • pass email and password in request body example :
       {
            "email" : "[email protected]",
            "password" : "password"
       }
      

    returns the token as a response

  • /users/secret/
    • pass a header called token : {the generated jwt token} example : returns success message as a reponse