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