Overview
@gablura/auth-next is a complete authentication solution for Next.js applications using NextAuth.js. It provides drop-in components (login/register forms, email verification, password reset), React hooks for form logic, API route handlers, and a bridge layer for secure communication with the @gablura/auth-core backend. Supports credentials login, Google OAuth, TOTP-based 2FA, and full email lifecycle (verification, forgot password, reset).
Why it exists
Setting up NextAuth.js from scratch with credentials provider, JWT callbacks, token exchange with a backend, email verification, password reset, and 2FA is a multi-day effort with many security pitfalls. Auth-next exists to make this a one-line integration. It handles the entire auth flow: form validation (Zod + react-hook-form), argon2 password hashing, HMAC-signed backend communication, automatic token refresh, session management, and all the UI components you need. You configure it once and get a production-ready auth system.