- Implemented JWT-based authentication system with access and refresh tokens - Added password hashing service using PBKDF2 - Created authentication handlers: register, login, refresh, logout - Added protected routes with JWT middleware - Created user profile handlers - Fixed all compilation errors - Added integration tests for authentication endpoints - Added reqwest dependency for testing - Created test script and environment example documentation All changes: - backend/src/auth/: Complete auth module (JWT, password, claims) - backend/src/handlers/: Auth, users, and health handlers - backend/src/middleware/: JWT authentication middleware - backend/src/config/: Added AppState with Clone derive - backend/src/main.rs: Fixed imports and added auth routes - backend/src/db/mod.rs: Changed error handling to anyhow::Result - backend/Cargo.toml: Added reqwest for testing - backend/tests/auth_tests.rs: Integration tests - thoughts/: Documentation updates (STATUS.md, env.example, test_auth.sh)
12 lines
276 B
Text
12 lines
276 B
Text
# MongoDB Configuration
|
|
MONGODB_URI=mongodb://localhost:27017
|
|
DATABASE_NAME=normogen
|
|
|
|
# JWT Configuration
|
|
JWT_SECRET=your-secret-key-here-change-in-production
|
|
JWT_ACCESS_TOKEN_EXPIRATION=900
|
|
JWT_REFRESH_TOKEN_EXPIRATION=604800
|
|
|
|
# Server Configuration
|
|
HOST=127.0.0.1
|
|
PORT=8000
|