Merge pull request #48 from uja-dev-practices/feature/input-manual
chore: enhance environment configuration for frontend and Google auth…
This commit is contained in:
@@ -19,3 +19,9 @@ GOOGLE_REDIRECT_URI=http://localhost:8070/api/auth/google/callback
|
|||||||
|
|
||||||
# Clave para firmar los JWT (usa algo largo y aleatorio en producción)
|
# Clave para firmar los JWT (usa algo largo y aleatorio en producción)
|
||||||
SECRET_KEY=cambia-esta-clave-en-produccion
|
SECRET_KEY=cambia-esta-clave-en-produccion
|
||||||
|
|
||||||
|
# URL del frontend a la que se redirige tras el login con Google
|
||||||
|
# Con docker-compose en local: http://localhost:8071
|
||||||
|
# Con Vite directo en local: http://localhost:5173
|
||||||
|
# En producción: https://tu-dominio.com
|
||||||
|
FRONTEND_URL=http://localhost:5173
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ GOOGLE_CLIENT_ID = os.getenv("GOOGLE_CLIENT_ID")
|
|||||||
GOOGLE_CLIENT_SECRET = os.getenv("GOOGLE_CLIENT_SECRET")
|
GOOGLE_CLIENT_SECRET = os.getenv("GOOGLE_CLIENT_SECRET")
|
||||||
REDIRECT_URI = os.getenv("GOOGLE_REDIRECT_URI")
|
REDIRECT_URI = os.getenv("GOOGLE_REDIRECT_URI")
|
||||||
SECRET_KEY = os.getenv("SECRET_KEY")
|
SECRET_KEY = os.getenv("SECRET_KEY")
|
||||||
|
FRONTEND_URL = os.getenv("FRONTEND_URL", "http://localhost:5173")
|
||||||
|
|
||||||
@router.get("/login")
|
@router.get("/login")
|
||||||
async def google_login():
|
async def google_login():
|
||||||
@@ -97,4 +98,4 @@ async def google_callback(request: Request):
|
|||||||
{"$set": {"token": token}}
|
{"$set": {"token": token}}
|
||||||
)
|
)
|
||||||
|
|
||||||
return RedirectResponse(f"http://localhost:5173/login?token={token}")
|
return RedirectResponse(f"{FRONTEND_URL}/login?token={token}")
|
||||||
@@ -21,6 +21,8 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./frontend:/app
|
- ./frontend:/app
|
||||||
- /app/node_modules
|
- /app/node_modules
|
||||||
|
environment:
|
||||||
|
- VITE_API_URL=http://localhost:8070/api
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user