Giter Site home page Giter Site logo

auth_server's Introduction

auth_server

post /api/user/register

production

  • checks to see if input is validated. changed in validation.js
  • checks the DB if the email exists
  • hashes the password if the email is unique
  • commits the new user to the db

example request body

{
    "first_name": "Sebastian",
    "last_name": "Loret de Mola",
    "email": "[email protected]",
    "password":"password"
}

post /api/user/login

production

  • checks to see if the input is valid
  • finds the user in DB by email
  • decrypts and compares the passwords
  • generate and issue refresh and access tokens
  • commits new token to user's db document

example request body

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

post /api/user/refresh

production

  • finds the user by token in body
  • checks to see if the token exists in the db
  • verifies the token and issues a new access token

example request body

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

get /api/user/test

production

  • checks to see if the route can be accessed with/without access token
  • can not be accessed with refresh token
  • finds the user in db using email send by json body
  • returns user details

example request body

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

delete /api/user/logout

production

  • finds user in db using email
  • updates token to "logged out" thus invalidating the refresh token
  • sends a status and message

example request body

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

use *

production

  • catch all that displays a 404 missing page
  • used to notify user of broken route

auth_server's People

Contributors

loretdemolas 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.