Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /Lampx83_LakeFlow /backend /src /lakeflow /api /auth.py
| from fastapi import APIRouter, HTTPException, status, Depends | |
| from lakeflow.api.schemas.auth import LoginRequest, TokenResponse | |
| from lakeflow.i18n import i18n_detail | |
| from lakeflow.core.auth import verify_token | |
| from lakeflow.services.auth_service import authenticate | |
| router = APIRouter() | |
| def login(data: LoginRequest): | |
| token = authenticate(data.username, data.password) | |
| if not token: | |
| raise HTTPException( | |
| status_code=status.HTTP_401_UNAUTHORIZED, | |
| detail=i18n_detail("auth.invalid_credentials"), | |
| ) | |
| return {"access_token": token} | |
| def me(payload: dict = Depends(verify_token)): | |
| """Return current user info from token (used to filter history per account).""" | |
| return {"username": payload["sub"]} | |
Xet Storage Details
- Size:
- 829 Bytes
- Xet hash:
- 19e3815018850813ebe5868a34c99f14b523ae5e89465828d461a69936eb746b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.