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:
@@ -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)}`;
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user