- Implemented endpoints for forgot password and reset password - Added PasswordResetToken model and relationships - Integrated email service using Resend for sending reset links - Updated configuration for email and frontend URL - Enhanced user model to include password reset tokens - Added necessary schemas for password reset requests - Updated requirements to include Resend SDK - Created comprehensive documentation for the new feature
30 lines
785 B
Python
30 lines
785 B
Python
from urllib.parse import quote_plus
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
DB_HOST: str = "localhost"
|
|
DB_PORT: int = 3306
|
|
DB_USER: str = "root"
|
|
DB_PASS: str = ""
|
|
DB_NAME: str = ""
|
|
DB_ECHO: bool = False
|
|
SECRET_KEY: str = "change-me-to-a-random-secret-key"
|
|
ALGORITHM: str = "HS256"
|
|
ACCESS_TOKEN_EXPIRE_MINUTES: int = 1440
|
|
GOOGLE_CLIENT_ID: str = ""
|
|
RESEND_API_KEY: str = ""
|
|
EMAIL_FROM: str = "noreply@profitra.id"
|
|
FRONTEND_URL: str = "http://localhost:3000"
|
|
|
|
@property
|
|
def DATABASE_URL(self) -> str:
|
|
return f"mysql+pymysql://{self.DB_USER}:{quote_plus(self.DB_PASS)}@{self.DB_HOST}:{self.DB_PORT}/{self.DB_NAME}"
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
|
|
|
|
settings = Settings()
|