first commit
This commit is contained in:
commit
efa5080897
127 changed files with 18610 additions and 0 deletions
18
backend/app/routes_otp.py
Normal file
18
backend/app/routes_otp.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
from fastapi import APIRouter, Depends
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from .api_key_auth import current_api_user
|
||||
from .database import get_db
|
||||
from .models import UserAccount
|
||||
from .otp_service import GenerateOtpPayload, generate_otp_for_user
|
||||
|
||||
router = APIRouter(prefix="/api/v1/otp", tags=["otp"])
|
||||
|
||||
|
||||
@router.post("/generate")
|
||||
def generate_otp(
|
||||
payload: GenerateOtpPayload,
|
||||
db: Session = Depends(get_db),
|
||||
user: UserAccount = Depends(current_api_user),
|
||||
) -> dict:
|
||||
return generate_otp_for_user(db, user, payload)
|
||||
Loading…
Add table
Add a link
Reference in a new issue