From e9a0d9ac621846f2fc15924c0b5ad2f17d458a5a Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Fri, 28 Mar 2025 19:13:08 +0000 Subject: [PATCH] Update code in endpoints/login.post.py --- endpoints/login.post.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/endpoints/login.post.py b/endpoints/login.post.py index 9305996..f84f936 100644 --- a/endpoints/login.post.py +++ b/endpoints/login.post.py @@ -2,12 +2,12 @@ from fastapi import APIRouter, Depends, HTTPException, status from sqlalchemy.orm import Session from core.database import get_db from models.user import User -from schemas.user import UserSchema, UserLogin +from schemas.user import UserLogin, UserResponse from helpers.auth_helpers import authenticate_user, create_access_token router = APIRouter() -@router.post("/login", status_code=200) +@router.post("/login", status_code=200, response_model=UserResponse) async def login( user_credentials: UserLogin, db: Session = Depends(get_db) @@ -21,4 +21,4 @@ async def login( ) access_token = create_access_token(data={"sub": user.email}) - return {"access_token": access_token, "token_type": "bearer"} \ No newline at end of file + return {"access_token": access_token, "token_type": "bearer", "user": user} \ No newline at end of file