d50c1c5bba
- Added .env.example for environment variable configuration. - Created app initialization files and core settings management. - Implemented API routers for reporting and transaction endpoints. - Developed transaction management service with CRUD operations. - Integrated Azure OAuth for user authentication. - Designed dashboard view with transaction filtering and display. - Added Swagger UI documentation with custom dark theme. - Created static and template files for frontend styling and layout.
23 lines
610 B
Python
23 lines
610 B
Python
from functools import lru_cache
|
|
|
|
from authlib.integrations.starlette_client import OAuth
|
|
|
|
from app.core.settings import get_settings
|
|
|
|
|
|
@lru_cache
|
|
def get_oauth() -> OAuth:
|
|
settings = get_settings()
|
|
oauth = OAuth()
|
|
oauth.register(
|
|
name="azure",
|
|
client_id=settings.azure_client_id,
|
|
client_secret=settings.azure_client_secret,
|
|
server_metadata_url=(
|
|
f"https://login.microsoftonline.com/{settings.azure_tenant_id}"
|
|
"/v2.0/.well-known/openid-configuration"
|
|
),
|
|
client_kwargs={"scope": "openid profile email"},
|
|
)
|
|
return oauth
|