Skip to content

kartikkc/recon-me

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

An Authentication API developed that supports google OAuth and provides 2FA using OTPs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published