Status: Done Phase: MVP (Phase 1) - Single user authentication Priority: High
Note: Phase 2 (Multi-user workspaces, sharing, permissions) has been extracted to Epic 16: Multi-User Workspaces. GitHub Issue: #7
Perfect for families and households who want to work together! This feature lets multiple people collaborate on a shared contact database while still keeping personal contacts private when you want them to be.
- Let multiple people use the same instance together
- Make family collaboration on shared contacts easy and intuitive
- Keep personal contacts private when you want them to be
- Give different users appropriate levels of access
- Keep track of who changed what (no mystery edits!)
- User registration and login
- Email/password authentication
- Password reset functionality
- Profile management (email)
- User preferences (contacts page size)
- Session management with JWT tokens
- Rate limiting on authentication endpoints
Note: Phase 2 features (Family/Group Spaces, Role-Based Permissions, Contact Ownership, Conflict Resolution, Activity Tracking) have been extracted to Epic 16: Multi-User Workspaces.
- As a user, I want to create an account so I can access my contacts securely
- As a user, I want to log in and out so I can protect my data
- As a user, I want to reset my password if I forget it
- As a user, I want to update my profile information
Note: Phase 2 user stories have been moved to Epic 16: Multi-User Workspaces.
auth.userstable with email, password_hash, preferences (JSONB)auth.sessionstable for authentication with token hashingauth.password_reset_tokenstable for password reset flow
- JWT tokens for API authentication
- HTTP-only cookies for web app
- Token refresh mechanism
- Session expiration (configurable)
- Password hashing (bcrypt)
POST /api/auth/register- Register new userPOST /api/auth/login- LoginPOST /api/auth/logout- LogoutPOST /api/auth/refresh- Refresh tokenPOST /api/auth/forgot-password- Request password resetPOST /api/auth/reset-password- Reset password with tokenGET /api/auth/me- Get current userPATCH /api/auth/preferences- Update user preferencesGET /api/users/me- Get current user profilePUT /api/users/me- Update profile
Note: Phase 2 API endpoints have been moved to Epic 16: Multi-User Workspaces.
- Registration form (
RegisterForm.svelte) - Login form (
LoginForm.svelte) - Password reset flow (
ForgotPasswordForm.svelte,ResetPasswordForm.svelte) - User profile page (
/profile) - Auth store with full state management
Note: Phase 2 components have been moved to Epic 16: Multi-User Workspaces.
- Rate limiting on authentication endpoints (5/min auth, 3/hour password reset)
- Strong password requirements (8+ chars, uppercase, lowercase, digit)
- SQL injection prevention via PgTyped parameterized queries
- Session token hashing (SHA-256)
- Users can register, login, and manage their accounts
- Authentication is secure and reliable
- Password reset flow works correctly
Note: Phase 2 success metrics have been moved to Epic 16: Multi-User Workspaces.
- Email service (for invitations and password resets)
- JWT library
- Password hashing library (bcrypt)
- Social login (Google, Facebook, etc. - we'll keep it simple for now)
- Two-factor authentication (2FA - future security enhancement)
- Single Sign-On (SSO)
- Advanced permission matrix (we're sticking with the basic roles for now)
- Real-time collaboration indicators (you won't see live cursors or anything fancy)
- Multi-tenancy isolation for SaaS (that's for a future version)
- Epic 1: Contact Management (contacts to be shared)
- Epic 4: Categorization & Organization (shared groups/tags)
- All other epics (require user context)