Authentication — Sign In, Sign Up & Password Reset
Overview
Interview OS uses Supabase Authentication for secure user identity management. The auth system supports email/password and Google OAuth, with session management, password reset, and security best practices.
Auth Flows
Sign Up
- Enter email, password, and display name
- Account created in Supabase Auth
- Profile record created automatically
- Redirected to onboarding or dashboard
Log In
- Enter email and password
- Session established with Supabase
- Redirect to dashboard
Google OAuth
- Click "Sign in with Google"
- Redirect to Google consent screen
- Callback creates/links account
- Redirect to dashboard
Forgot Password (/auth/reset-password)
- Enter email on login form
- Receive password reset email
- Click link →
/auth/reset-password page
- Enter new password
- Confirmation and redirect to login
Sign Out
- Available in sidebar footer (desktop) and mobile header
- Clears Supabase session
- Redirects to landing page
Session Management
- Sessions are managed by Supabase Auth
useSession() hook provides session state across the app
AppShell component enforces auth guard — redirects to / if no session
- Auth state is checked on every protected page
Security Features
| Feature |
Implementation |
| Password Hashing |
Supabase Auth (bcrypt/scrypt) |
| OAuth State |
PKCE flow for Google OAuth |
| Session Tokens |
JWT with expiration and refresh |
| Rate Limiting |
Supabase Auth built-in rate limiting |
| Redirect Validation |
Forgot-password redirect_to derived from request headers |
Error Handling
| Error |
User Message |
| Invalid credentials |
"Invalid email or password" |
| Email already registered |
"An account with this email already exists" |
| Weak password |
Password strength requirements |
| Expired reset link |
"This link has expired. Request a new one" |
| OAuth failure |
"Google sign-in failed. Please try again" |
| Rate limited |
"Too many attempts. Please try again later" |
Related Docs
- [[landing]] — Auth panel is on the landing page
- [[settings]] — Security settings, password change, session management
- [[profile]] — Profile creation after sign-up