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.
- 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
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
.
Copy the client code to your project or use it as reference:
cp -r node_modules/jwt-authx/client/* ./
Copy the server code to your project or use it as reference:
cp -r node_modules/jwt-authx/server/* ./