From 0449560ae1f15d57d24b88f8bf5d0a3edd976ad6 Mon Sep 17 00:00:00 2001 From: Mireya Cueto Garrido Date: Mon, 13 Apr 2026 13:01:30 +0200 Subject: [PATCH] =?UTF-8?q?Eliminadas=20importaciones=20innecesarias=20y?= =?UTF-8?q?=20se=20actualiz=C3=B3=20la=20respuesta=20del=20callback=20de?= =?UTF-8?q?=20Google=20para=20redirigir=20con=20el=20token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/api/routers/google_auth.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/backend/api/routers/google_auth.py b/backend/api/routers/google_auth.py index 3fec964..c7e5f77 100644 --- a/backend/api/routers/google_auth.py +++ b/backend/api/routers/google_auth.py @@ -1,9 +1,7 @@ # api/routers/google_auth.py -from fastapi import APIRouter, HTTPException, Depends, Request +from fastapi import APIRouter, HTTPException, Request from fastapi.responses import RedirectResponse -from pydantic import BaseModel -from bson import ObjectId import httpx import os import jwt @@ -36,7 +34,6 @@ async def google_login(): return RedirectResponse(google_auth_url) - # ----------------------------- # 2. CALLBACK → GOOGLE DEVUELVE EL CODE # ----------------------------- @@ -95,4 +92,4 @@ async def google_callback(request: Request): token = create_access_token({"user_id": str(user_id)}) - return {"message": "Login con Google exitoso", "token": token} + return RedirectResponse(f"http://localhost:5173/login?token={token}")