Auth Simple
A complete, secure authentication system with login, register, email verification, and password reset functionality built with Next.js server actions.
Simple Auth System
A comprehensive, production-ready authentication system that provides secure user management with email verification, password reset, and beautiful UI components. Built with Next.js server actions, Prisma, and modern security practices.

Installation
Install the component using the AxionJS CLI:
Configure your environment variables in .env
:
Set up Prisma schema and push to database:
The component includes complete database models, email templates, server actions, and UI components. Everything is pre-configured for immediate use.
Database Schema
Add the following models to your schema.prisma
file:
Usage
The LoginForm component includes:
- Email and password validation
- Secure credential verification
- Automatic email verification check
- Redirect handling with callback URLs
- Loading states and error handling
Key Features
Secure Authentication
Password hashing with bcrypt, JWT tokens, and CSRF protection
Email Verification
Beautiful HTML emails with secure token-based verification
Password Reset
Secure password reset flow with time-limited tokens
Form Validation
Comprehensive validation using Zod schemas with real-time feedback
Server Actions
Modern Next.js server actions for secure backend operations
Responsive Design
Mobile-first design with beautiful UI components
Server Actions
The authentication system uses Next.js server actions for secure backend operations:
Email Templates
The system includes professional, responsive email templates:
Security Features
The Simple Auth system implements comprehensive security measures:
- Password Hashing: Secure bcrypt hashing with salt rounds
- JWT Tokens: Secure session management with NextAuth.js
- Email Verification: Mandatory email verification for new accounts
- Token Expiration: Time-limited tokens for security (24h verification, 1h reset)
- CSRF Protection: Built-in protection against cross-site request forgery
- Input Validation: Comprehensive Zod schema validation
- SQL Injection Protection: Prisma provides built-in protection
- Rate Limiting: Configurable rate limiting for authentication endpoints
Always use HTTPS in production and ensure your email provider supports secure authentication. Consider implementing additional security measures like account lockout policies for production use.
Component Structure
The authentication system includes the following components:
- LoginForm: Handles user login with email verification check
- RegisterForm: User registration with automatic email verification
- ResetForm: Password reset request form
- NewPasswordForm: New password setting after reset
- NewVerificationForm: Email verification handling
- CardWrapper: Reusable card wrapper for consistent styling
- FormError/FormSuccess: Standardized error and success message components
Conclusion
The Simple Auth system provides a complete, production-ready authentication solution for Next.js applications. With its comprehensive security features, beautiful UI components, and modern server actions integration, it offers both excellent developer experience and robust user authentication capabilities.