From f77f2700f2c2c5d003b36242a06ebd86d4800b08 Mon Sep 17 00:00:00 2001 From: Felipe Cardoso Date: Sun, 2 Nov 2025 04:53:09 +0100 Subject: [PATCH] Simplify token response in authentication route by returning the entire `Token` object instead of manually formatting a subset. --- backend/app/api/routes/auth.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/backend/app/api/routes/auth.py b/backend/app/api/routes/auth.py index 725a6cd..c387f88 100755 --- a/backend/app/api/routes/auth.py +++ b/backend/app/api/routes/auth.py @@ -216,12 +216,8 @@ async def login_oauth( except Exception as session_err: logger.error(f"Failed to create session for {user.email}: {str(session_err)}", exc_info=True) - # Format response for OAuth compatibility - return { - "access_token": tokens.access_token, - "refresh_token": tokens.refresh_token, - "token_type": tokens.token_type - } + # Return full token response with user data + return tokens except AuthenticationError as e: logger.warning(f"OAuth authentication failed: {str(e)}") raise AuthError(