Skip to content
/ elytra Public

A QR code authentication system built with Node.js, Express, and MongoDB. It allows users to generate a QR code for login and verifies the QR token to authenticate and log in the user.

Notifications You must be signed in to change notification settings

Dev-29/elytra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QR Code based Authentication System

A QR code authentication system built with Node.js, Express, and MongoDB. It allows users to generate a QR code for login and verifies the QR token to authenticate and log in the user.

Features

  • User registration and login
  • QR code generation for login
  • QR token verification for authentication
  • MongoDB for data storage

Installation

  1. Clone the repository:
$ git clone https://github.com/Dev-29/elytra.git
  1. Install dependencies:
npm install
  1. Set up environment variables:
  • Create a .env file the root directory of the project.the root directory of the project.
  • Add the following environment variables to the .env file:
  • PORT=3000
  • MONGODB_URI=mongodb://localhost:27017/qr_auth
  • JWT_SECRET=your-secret-key

Usage

  1. Start the mongod service:
mongod
  1. Start the server:
npm start
  1. Open postman tool
  2. Generate QR code: Send a POST request to 'localhost:3000/auth/login':
{
	"email": "example@gmail.com
}

The response will contain a qrCodeUrl field with the URL of the generated QR code.

  1. Verify the QR code:
{
	"qrToken": "<QR-TOKEN>"
}

Replace <QR_TOKEN> with the value of the QR token displayed in the generated QR code.

  • If the QR token is valid, you will receive a response with a success message indicating that the user is logged in.

About

A QR code authentication system built with Node.js, Express, and MongoDB. It allows users to generate a QR code for login and verifies the QR token to authenticate and log in the user.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published