Automated Action d63fc9b68d Implement complete Enviodeck Authentication API with FastAPI
- Phone number authentication with OTP verification
- Email/password authentication with secure bcrypt hashing
- Third-party OAuth login support for Google and Apple
- JWT token-based authentication system
- Rate limiting for OTP requests (5/minute)
- SQLite database with SQLAlchemy ORM
- Comprehensive user model with multiple auth providers
- Alembic database migrations setup
- API documentation with Swagger/OpenAPI
- Health check and system endpoints
- Environment configuration with security best practices
- Code quality with Ruff linting and formatting

Features:
- POST /auth/request-otp - Request OTP for phone authentication
- POST /auth/verify-otp - Verify OTP and get access token
- POST /auth/signup-email - Email signup with password
- POST /auth/login-email - Email login authentication
- POST /auth/login-google - Google OAuth integration
- POST /auth/login-apple - Apple OAuth integration
- GET /user/me - Get current authenticated user info
- GET / - API information and documentation links
- GET /health - Application health check
2025-06-21 08:59:35 +00:00

12 lines
347 B
Python

from fastapi import APIRouter, Depends
from app.schemas.user import User
from app.utils.dependencies import get_current_active_user
router = APIRouter()
@router.get("/me", response_model=User)
async def get_current_user_info(current_user: User = Depends(get_current_active_user)):
"""Get current user information"""
return current_user