jwt-authx
v1.0.1
Published
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) s
Maintainers
Readme
🔐 jwt-authx : JWT Authentication & Authorization with 2FA
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 .envThen 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/* ./