fix: resolve Google login hydration mismatch and dynamic env load
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m42s

This commit is contained in:
2026-06-07 12:21:06 +02:00
parent 5b8c29dae6
commit feea02033b
6 changed files with 127 additions and 7 deletions

View File

@@ -620,6 +620,7 @@ async def google_auth_v1(body: GoogleAuthRequest):
try:
user = get_or_create_google_user(email=email, name=name, avatar_url=avatar_url)
except Exception as exc:
logger.exception("Google authentication failed in get_or_create_google_user")
return JSONResponse(
status_code=500,
content={"error": "USER_CREATE_FAILED", "message": str(exc)},
@@ -641,6 +642,21 @@ async def google_auth_v1(body: GoogleAuthRequest):
)
@router_v1.get("/config")
async def get_auth_config():
"""Retrieve public configuration settings, such as Google Client ID."""
return JSONResponse(
status_code=200,
content={
"data": {
"google_client_id": os.getenv("GOOGLE_CLIENT_ID", ""),
"google_auth_enabled": bool(os.getenv("GOOGLE_CLIENT_ID", "").strip()),
},
"meta": {},
},
)
@router_v1.post("/refresh")
async def refresh_v1(request: Request):
"""Refresh tokens (API v1) — accepte refresh_token en corps, retourne nouvel access_token et refresh_token."""