GithubHelp home page GithubHelp logo

assignment's Introduction

                        # API DOC #

To Start the Project

   npm install
   npm start

For all third party services such as Google, facebook, twilio, jwt and aws-ses we need secret keys and id's which are stored in environment varaibles. so to get this environment file email at [email protected]. place that .env file in project's folder.

Used JsonWebToken for the detection of login from the multiple devices. if found a valid Json web token in DB then it means a user has a valid session previously. so will create a new json web token and store in DB to establish a new session.

This project have endpoints provided below. login and signup works good. when you enable double authentication then login will be done through recieving OTP at your mobile number or at your email. but in twilio trial account we cannot send OTP to unregistered mobile number. so you will be able to send OTP to only my number 9041306219. same with case of email.

Root URL Try this endpoint in your browser

 on server  http://159.65.157.18:3000/ 
 server is running with nohup

 on local  http://localhost:3000/

Endpoints for Signup and Login

  1.  /signup
     method: POST
     payload: {
        fullName:'Kunal Pal',
        phoneNo: '9041306219',
        email: '[email protected]',
        dob: '08/12/1995',
        password: ********
     }
    
  2. /login
    method: POST
    payload: {
        email:'[email protected]',
        password: ********
    }
    

Endpoints for Google/Facebook login

Try these endpoints in your Browser

  1.  /auth/google
     open this endpoint in your browser you will be redirected to the google login page enter the credential and you will be redirected the success login page. But at here you will be redirected to the login page but you won't be redirected to the success login page because my google api app is still in development mode not a published one.
    
  2.  /auth/facebook
     open this endpoint in your browser you will be redirected to the facebook login page, enter the credential and you will be redirected to the success login page. But at here you will be redirected to the login page but you won't be redirected to the success login page because my facebook graph app is still in development mode not a published one.
    

Endpoints for verifying the OTP

  1.  /verifyPhone
     method: POST,
     paylaod: {
         phoneNo: 9041306219,
         otp: ******
     }
    
  2.  /verifyEmail
     method: POST
     payload: {
         email: '[email protected]',
         otp: ******
     }
    

Endpoint for Enabling Double Authentication

  1.  /enableDoubleAuth
     method: POST
     payload: {
         email: '[email protected]',
         password: ********
     }
    

assignment's People

Contributors

kunal8195 avatar

Watchers

James Cloos 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.