Authentication Overview
The Ever Works provides a flexible, secure authentication system that supports multiple providers and authentication methods.
Authentication Architecture
The template uses a hybrid authentication approach, supporting both NextAuth.js and Supabase Auth simultaneously, allowing you to choose the best solution for your needs.
graph TB
User[User] --> Choice{Auth Method}
Choice -->|NextAuth.js| NextAuth[NextAuth.js]
Choice -->|Supabase| Supabase[Supabase Auth]
NextAuth --> OAuth1[OAuth Providers]
NextAuth --> Credentials[Email/Password]
NextAuth --> JWT1[JWT Tokens]
Supabase --> OAuth2[OAuth Providers]
Supabase --> Magic[Magic Links]
Supabase --> JWT2[JWT Tokens]
JWT1 --> Session[Session Management]
JWT2 --> Session
Session --> Protected[Protected Routes]
Supported Authentication Methods
1. OAuth Providers
NextAuth.js OAuth
- Google - Google OAuth 2.0
- GitHub - GitHub OAuth
- Facebook - Facebook Login
- Twitter/X - Twitter OAuth 2.0
- Microsoft - Microsoft OAuth 2.0
Supabase OAuth
- Google - Google OAuth 2.0
- GitHub - GitHub OAuth
- Facebook - Facebook Login
- Twitter/X - Twitter OAuth 2.0
- Discord - Discord OAuth
- Apple - Sign in with Apple
2. Email/Password Authentication
NextAuth.js Credentials
- Custom email/password authentication
- Password hashing with bcrypt
- Custom validation logic
- Database session storage
Supabase Auth
- Built-in email/password authentication
- Email verification
- Password reset functionality
- Secure password policies