Fix: leer PUBLIC_SUPABASE_* de process.env en SSR

Vite hornea import.meta.env.PUBLIC_* en build time, pero el Dockerfile
no tiene .env.production disponible durante `docker build` (correcto,
por seguridad). Cambia el server client y la página de login para leer
las vars desde process.env, que sí llega vía env_file en runtime.
El browserClient no lo usa ningún island — se mantiene con
import.meta.env para el día que se necesite.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-08-14 19:46:03 -07:00
parent 1121ab7199
commit 73abf3c8b4
2 changed files with 8 additions and 5 deletions
+2 -2
View File
@@ -9,8 +9,8 @@ const errorMsg = errorParam === 'dominio'
? 'No se pudo completar la autenticación con Google. Inténtalo de nuevo.'
: null;
const appUrl = import.meta.env.PUBLIC_APP_URL ?? url.origin;
const supabaseUrl = import.meta.env.PUBLIC_SUPABASE_URL;
const appUrl = process.env.PUBLIC_APP_URL ?? import.meta.env.PUBLIC_APP_URL ?? url.origin;
const supabaseUrl = process.env.PUBLIC_SUPABASE_URL ?? import.meta.env.PUBLIC_SUPABASE_URL;
const redirectTo = `${appUrl}/api/auth/callback`;
const googleAuthUrl = `${supabaseUrl}/auth/v1/authorize?provider=google&redirect_to=${encodeURIComponent(redirectTo)}`;
---