Giter Site home page Giter Site logo

recon-me's Introduction

R3C0N-M3: Authentication API

Your Gateway to Secure Access

Website : https://recon-me.vercel.app

Docs : https://recon-me-doc.vercel.app

Features

  • Signup Using Email and generation of JWT token.
  • Login
  • Getting User details using JWT token.
  • Verifing User using OTP on corresponding email.
  • Authentication using Google.

Endpoints

Sign-up

Sending the User Details

POST https://recon-me.vercel.app/createuser/

Body :

Parameter Type Description
email string Required Email Address
name string Required Name
password string Required Password

Usage

javascript:

const createNewUser = await fetch(`https://recon-me.vercel.app/createuser/`, {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({name:credentials.name ,email: credentials.email, password: credentials.password})
});
const json = await createNewUser.json();
console.log(json);

Response

{
  "status": "Success! User Created! Please Continue to Verify your Account",
  "authToken": "esJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiNjUxZDZkNDc4N2RhMDcwMDA4MDM4YWQ4In0sImlhdCI6MTY5NjQyNzMzNX0.NMzkynrn7fmZuO1HBkOtBsaWIyzM0dq_MaB0Lft5WPA"
}

Verfiying User

POST https://recon-me.vercel.app/createuser/verify/

Body:

Parameter Type Description
otp Integer Required Email Address

*setting the auth-token as a header to the request.

Usage

javascript:

const verfiyNewUser = await fetch(`https://recon-me.vercel.app/createuser/verify`, {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({otp: otp.number});
});
const json = await verifyNewUser.json();
console.log(json);

Response

{
  "status": {
    "status": "User Verified"
  }
}

Log-In

Using Email

POST https://recon-me.vercel.app/login

Body :

Parameter Type Description
email string Required Email Address
password string Required Password

Usage

javascript:

const userLogin = await fetch(`https://recon-me.vercel.app/login`, {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({email: credentials.email, password: credentials.password})
});
const json = await userLogin.json();
console.log(json);

Response

If the user is not verified :

{
  "Verify": "Please verify your account to activate it."
}

After verifying using OTP:

{
  "authToken": "exJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiNjUxZDZkNDc4N2RhMDcwMDA4MDM4YWQ4In0sImlhdCI6MTY5NjQyNzMzNX0.NMzkynrn7fmZuO1HBkOtBsaWIyzM0dq_MaB0Lft5WPA"
}

Authentication with Google

GET https://recon-me.vercel.app/googleLogin/auth/google

Usage

javascript:

<a href='https://recon-me.vercel.app/googleLogin/auth/google' target='_blank'>Continue with Google</Link>

Response

{	
    "status":	"not verified"
    "otp":	"3043"
}

Verifying account created using google login

POST https://recon-me.vercel.app/verifyOtp

Body :

Parameter Type Description
otp Integer Required Password

*setting the googleId as a header to the request

Usage

javascript:

const googleUserVerify = await fetch(`https://recon-me.vercel.app/verifyOtp`, {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({otp: otp.otp})
});
const json = await googleUserVerify.json();
console.log(json);

Response

{
  "status": {
    "status": "User Verified"
  },
  "auth-token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY1MWQ4Mjg5NGI2NTU2MDAwODU0ZDE3ZCIsImlhdCI6MTY5NjQzMjc5MH0.bhNc0fuzPYhqw2nCm8C6SE1s31q5AWsiUmLTf7HBtco"
}

Support

For any issue or query. Contact me at : [email protected]

Contribute to this API here

Contact me

recon-me's People

Contributors

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