Skip to content

feat: implement forgot password with 6-digit OTP system #57

Merged
ngocbd merged 6 commits intoAI-Decenter:mainfrom
buihaigiap:buihaigiap-patch-1
Sep 22, 2025
Merged

feat: implement forgot password with 6-digit OTP system #57
ngocbd merged 6 commits intoAI-Decenter:mainfrom
buihaigiap:buihaigiap-patch-1

Conversation

@buihaigiap
Copy link
Contributor

No description provided.

✨ Features:
- Add forgot password API endpoint (/api/v1/auth/forgot-password)
- Add OTP verification API endpoint (/api/v1/auth/verify-otp)
- 6-digit OTP code generation using rand crate
- Email service with Gmail SMTP integration
- Redis cache for OTP storage with TTL (15 minutes)
- HTML email templates for OTP display
- Password reset with Argon2 hashing
- Complete Swagger documentation

🔧 Technical Details:
- Redis cache for OTP expiration and one-time use
- Secure random 6-digit code generation (100000-999999)
- Email service using lettre crate with SMTP
- Proper error handling and validation
- Request/Response schemas with OpenAPI docs

�� Email Configuration:
- Gmail SMTP support with app passwords
- HTML email templates with centered OTP display
- Configurable SMTP settings via environment

🔒 Security Features:
- OTP expiry (configurable TTL)
- One-time use validation
- Secure password hashing with Argon2
- Input validation and sanitization
- Update Fe-AI-Decenter with latest configuration changes
- Sync frontend with backend forgot password features
�� Frontend Features:
- Complete React TypeScript application
- Authentication pages (login, register, forgot/reset password)
- Repository management interface
- Organization management system
- Docker Registry browser UI
- Responsive design with Tailwind CSS

📦 Technical Stack:
- React 18 with TypeScript
- Vite for build tooling
- Tailwind CSS for styling
- React Router for navigation
- API integration with backend

🔧 Components:
- Authentication flow UI
- Repository browsing and management
- Organization member management
- Docker command snippets
- Settings and profile pages

🚀 Integration:
- Converted from submodule to integrated frontend
- All source files now part of main Aerugo repository
- Development server integration with backend
- Add comprehensive environment variable defaults for easier deployment
- Include server, database, storage, cache, and auth configurations
- Fix start.sh path from ./start.sh to /start.sh
- Enable simple docker run with only DATABASE_URL required
- All other environment variables now have sensible defaults
- Supports both development and production deployments
- Change S3_ENDPOINT from localhost:9001 to host.docker.internal:9001
- Change REDIS_URL from localhost:6379 to host.docker.internal:6379
- This allows containers to connect to services running on host machine
- Fixes issue when running container on different machines
- Maintains backward compatibility with --network host mode
@ngocbd ngocbd merged commit 83f92d3 into AI-Decenter:main Sep 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants