test-z3and9/endpoints/login.post.py

11 lines
379 B
Python

from fastapi import APIRouter, status
from schemas.user import UserLogin
from helpers.user_helpers import authenticate_user
router = APIRouter()
@router.post("/login", status_code=status.HTTP_200_OK, response_model=bool)
async def login(user_data: UserLogin):
"""Authenticate user"""
is_authenticated = authenticate_user(user_data=user_data)
return is_authenticated