- New /super-admin/login and /super-admin routes with separate auth - Super admin can view all registered accounts and impersonate any user - Impersonation banner shows at top of screen with exit button - ADMIN_USERNAME and ADMIN_PASSWORD config added to .env and docker-compose.yml - Fixed auth store: export setToken, clearToken, and setUser so they are accessible from superAdmin store - Updated README with super admin feature, new env vars, and setup notes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
26 lines
633 B
Python
26 lines
633 B
Python
from pydantic_settings import BaseSettings
|
|
from functools import lru_cache
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
database_url: str
|
|
secret_key: str
|
|
algorithm: str = "HS256"
|
|
access_token_expire_minutes: int = 30
|
|
refresh_token_expire_days: int = 30
|
|
cors_origins: str = "http://localhost:8054"
|
|
admin_username: str = "admin"
|
|
admin_password: str = "change_me_admin_password"
|
|
|
|
@property
|
|
def cors_origins_list(self) -> list[str]:
|
|
return [o.strip() for o in self.cors_origins.split(",")]
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
return Settings()
|