claude-os/docs
Bob Roberts 1b835c3a3e Add simple email/password authentication to frontend
Implemented optional authentication to keep strangers out of the
Claude OS frontend when deployed to production servers.

Backend (FastAPI):
- mcp_server/auth.py: JWT-based authentication
  * Bcrypt password hashing
  * Environment-based user credentials (no database needed)
  * 7-day token expiration
  * Optional - disabled by default

- mcp_server/server.py: Auth endpoints
  * POST /api/auth/login - Returns JWT token
  * GET /api/auth/me - Get current user
  * GET /api/auth/status - Check if auth enabled

- requirements.txt: Added dependencies
  * passlib[bcrypt] for password hashing
  * python-jose[cryptography] for JWT
  * python-multipart for form data

Frontend (React):
- frontend/src/lib/auth.tsx: Auth context and hooks
  * Manages authentication state
  * Automatic token validation
  * localStorage for token persistence

- frontend/src/pages/Login.tsx: Beautiful login page
  * Gradient design matching Claude OS branding
  * Clear error messages
  * Loading states

- frontend/src/components/ProtectedRoute.tsx: Route protection
  * Automatically redirects to login if not authenticated
  * Shows loading state during auth check
  * Bypasses auth if disabled

- frontend/src/App.tsx: Integrated auth
  * Wrapped app in AuthProvider
  * Protected routes for Welcome and MainApp
  * Login route for authentication

Documentation:
- AUTH_SETUP.md: Complete authentication guide
  * Quick start instructions
  * Password hash generation
  * Production deployment steps
  * Troubleshooting guide

- .env.example: Added auth configuration
  * CLAUDE_OS_EMAIL (login email)
  * CLAUDE_OS_PASSWORD (dev - plain text)
  * CLAUDE_OS_PASSWORD_HASH (production - bcrypt hash)
  * CLAUDE_OS_SECRET_KEY (JWT secret)

- docs/PRODUCTION_DEPLOYMENT.md: Added Step 5
  * Authentication setup for production
  * Hash and secret generation commands
  * Testing instructions

Features:
✅ Optional authentication (disabled by default)
✅ Single user via environment variables
✅ Secure bcrypt hashing
✅ JWT tokens with 7-day expiration
✅ Beautiful login UI
✅ No database required for user management

Usage:
1. Set CLAUDE_OS_EMAIL and CLAUDE_OS_PASSWORD in .env
2. Restart Claude OS
3. Visit /login to authenticate
4. Token valid for 7 days

To disable auth: Remove CLAUDE_OS_EMAIL from .env

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-30 21:07:53 -05:00
..
BLOCK_CASE_STUDY_TUFFY_APPOINTMENT_FORM.md Almost got the mosnter finished 2025-10-27 17:41:44 -05:00
BLOCK_SYSTEM_RESEARCH_FINDINGS.md Almost got the mosnter finished 2025-10-27 17:41:44 -05:00
BLOCKS_DEPRECATION_STRATEGY.md Almost got the mosnter finished 2025-10-27 17:41:44 -05:00
CLAUDE_OS_VISION.md Almost got the mosnter finished 2025-10-27 17:41:44 -05:00
DELETE_DOCUMENTS_GUIDE.md Almost got the mosnter finished 2025-10-27 17:41:44 -05:00
design-guide.md Almost got the mosnter finished 2025-10-27 17:41:44 -05:00
MCP_KB_ENDPOINTS.md Almost got the mosnter finished 2025-10-27 17:41:44 -05:00
MEMORY_MCP_GUIDE.md Almost got the mosnter finished 2025-10-27 17:41:44 -05:00
NATIVE_VS_DOCKER_DECISION.md Almost got the mosnter finished 2025-10-27 17:41:44 -05:00
PERFORMANCE_TEST_RESULTS.md Almost got the mosnter finished 2025-10-27 17:41:44 -05:00
PRODUCTION_DEPLOYMENT.md Add simple email/password authentication to frontend 2025-10-30 21:07:53 -05:00
QUICK_REFERENCE.md Add database copy deployment strategy (THE SECRET SAUCE!) 2025-10-30 20:48:34 -05:00
QUICK_START_CLAUDE_OS.md Almost got the mosnter finished 2025-10-27 17:41:44 -05:00
README_CLAUDE_OS.md Almost got the mosnter finished 2025-10-27 17:41:44 -05:00
README_NATIVE_SETUP.md Almost got the mosnter finished 2025-10-27 17:41:44 -05:00
REAL_TIME_LEARNING_COMPLETE.md Almost got the mosnter finished 2025-10-27 17:41:44 -05:00
REAL_TIME_LEARNING_GUIDE.md Almost got the mosnter finished 2025-10-27 17:41:44 -05:00
SCRIPTS_GUIDE.md Almost got the mosnter finished 2025-10-27 17:41:44 -05:00
SELF_LEARNING_SYSTEM.md Add comprehensive Self-Learning System documentation 2025-10-27 20:29:04 -05:00
SHARING.md Almost got the mosnter finished 2025-10-27 17:41:44 -05:00
SLUG_IMPLEMENTATION_SUMMARY.md Almost got the mosnter finished 2025-10-27 17:41:44 -05:00
STARTUP_SCRIPTS_COMPLETE.md Almost got the mosnter finished 2025-10-27 17:41:44 -05:00