A reusable authentication foundation for developers who don't want to rebuild login, sessions, roles, permissions, password changes and admin access from scratch for every new application.
VaultAuth packages the recurring authentication concerns of a modern web application into a starter system that can be adapted to a product instead of recreated for every project.
Short-lived access JWTs are kept in Redux memory while refresh tokens use an
httpOnly cookie and Redis-backed token allow-listing.
Role middleware handles broad access such as admin, while permission
and attribute checks support finer-grained authorization decisions.
BullMQ moves background jobs away from the request path, while Node cluster can run one worker process per CPU core in production.
A clean, modern and distraction-free login page built with Next.js 14 and Tailwind CSS. The frontend gives developers a working authentication experience instead of leaving the UI layer to be assembled later.
Login · Next.js 14
Dashboard · Account security
The included dashboard provides the essential account information and security controls without adding unnecessary product-specific complexity.
Admin-only user management is part of the supplied application flow. The protected user list demonstrates how role-based access can control administrative functionality.
Admin · User management
The documented default is a 15-minute access token and a 7-day refresh token, with Redis-backed refresh-session allow-listing.
Access tokens are short-lived JWTs kept in Redux memory rather than localStorage.
Refresh tokens are longer-lived JWTs stored in an httpOnly cookie,
allow-listed in Redis by a per-token jti, and rotated on use.
RBAC provides the coarse-grained role boundary documented by the project, while ABAC supports permission claims and runtime predicates such as resource ownership.
user and admin rolesRequest handling, authentication, authorization, persistence and background work are kept as distinct pieces of the system.
Registration can enqueue a welcome-email job rather than performing the work inside the request. The separate worker can scale independently from the API.
In production mode, Node cluster can fork one worker process per CPU core and restart a worker after a crash.
The current repository uses a Node.js backend and a Next.js frontend with explicit infrastructure boundaries.
These are the routes documented by the current VaultAuth README.
| Method | Route | Auth | Purpose |
|---|---|---|---|
| POST | /api/auth/register | — | Create account and return tokens |
| POST | /api/auth/login | — | Authenticate a user |
| POST | /api/auth/refresh | Cookie | Rotate refresh token |
| POST | /api/auth/logout | Bearer | Revoke current session |
| POST | /api/auth/logout-all | Bearer | Revoke all user sessions |
| GET | /api/auth/me | Bearer | Return current user profile |
| POST | /api/auth/change-password | Bearer | Change password and revoke other sessions |
| GET | /api/users | Bearer + admin | List all users |
| PATCH | /api/users/:id/role | Bearer + admin | Change a user's role |
The README calls out several production settings that should be applied before deploying the system publicly.
COOKIE_SECURE=true with HTTPSVaultAuth is being developed as a reusable authentication starter for developers who want a structured starting point for new applications.
It is still in development and will be shortly available to all users.