Skip to content

An npm package for complete JWT-based OAuth system with client and server components, featuring OTP verification via Resend and MongoDB as the database.

Notifications You must be signed in to change notification settings

Nishant891/jwt-authx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔐 jwt-authx : JWT Authentication & Authorization with 2FA

🎥 Demo on Loom

Description

Complete JWT-based OAuth system with client and server components, featuring OTP verification via Resend and MongoDB as the database. This package provides a robust authentication and authorization framework with built-in Two-Factor Authentication (2FA) support, making it secure, scalable, and easy to integrate into modern applications.

✨ Features

  • Secure login and signup with JWT tokens
  • Role-based authorization (e.g., user, admin)
  • Two-Factor Authentication (2FA) via TOTP (Google Authenticator, Authy, etc.)
  • Token refresh and expiration handling
  • Built with scalability and security best practices

Installation

npm install jwt-authx

## Quick Setup

## 1. Copy the environment template

```bash
cp node_modules/jwt-authx/.env.example .env

Then fill in your environment variables in .env.

2. For the Client (Next.js)

Copy the client code to your project or use it as reference:

cp -r node_modules/jwt-authx/client/* ./

3. For the Server (Express)

Copy the server code to your project or use it as reference:

cp -r node_modules/jwt-authx/server/* ./

About

An npm package for complete JWT-based OAuth system with client and server components, featuring OTP verification via Resend and MongoDB as the database.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published