Files
Fulfillment-Backend/routers/auth.py
2024-03-03 07:22:42 +03:00

19 lines
548 B
Python

from typing import Annotated
from fastapi import APIRouter, Depends
from sqlalchemy.ext.asyncio import AsyncSession
from backend.session import get_session
from schemas.auth import AuthLoginRequest, AuthLoginResponse
from services.auth import AuthService
auth_router = APIRouter(
prefix='/auth',
tags=['auth'],
)
@auth_router.post('/login', response_model=AuthLoginResponse)
async def login(request: AuthLoginRequest, session: Annotated[AsyncSession, Depends(get_session)]):
return await AuthService(session).authenticate(request)