From 9c004ca8794d807170de74e1e12bdf406601cf23 Mon Sep 17 00:00:00 2001 From: Felipe Coutinho Date: Sun, 16 Nov 2025 00:54:04 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20remover=20vari=C3=A1vel=20de=20ambiente?= =?UTF-8?q?=20NEXT=5FPUBLIC=5FGOOGLE=5FOAUTH=5FENABLED?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removida a variável de ambiente NEXT_PUBLIC_GOOGLE_OAUTH_ENABLED do arquivo .env.example e ajustada a lógica de verificação do login com Google no cliente de autenticação. Agora, a disponibilidade do login com Google sempre retorna true, e a validação real deve ser feita no servidor. Também removido o script de lint do package.json. --- .env.example | 1 - lib/auth/client.ts | 16 +++++++++++----- package.json | 1 - 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.env.example b/.env.example index c90337b..5e631fe 100644 --- a/.env.example +++ b/.env.example @@ -34,7 +34,6 @@ RESEND_FROM_EMAIL=noreply@example.com # Google: https://console.cloud.google.com/apis/credentials GOOGLE_CLIENT_ID= GOOGLE_CLIENT_SECRET= -NEXT_PUBLIC_GOOGLE_OAUTH_ENABLED=true # === AI Providers (Opcional) === ANTHROPIC_API_KEY= diff --git a/lib/auth/client.ts b/lib/auth/client.ts index 5e3bec0..7935f77 100644 --- a/lib/auth/client.ts +++ b/lib/auth/client.ts @@ -7,9 +7,15 @@ export const authClient = createAuthClient({ }); /** - * Indica se o login com Google está habilitado - * Baseado na variável de ambiente NEXT_PUBLIC_GOOGLE_OAUTH_ENABLED + * Indica se o login com Google está habilitado. + * Verifica se as credenciais do Google OAuth estão configuradas. + * + * IMPORTANTE: Como variáveis de ambiente sem prefixo NEXT_PUBLIC_ não estão + * disponíveis no cliente, esta verificação deve ser feita no servidor. + * Por isso, sempre retornamos true aqui e a validação real acontece no servidor. + * + * Para desabilitar o Google OAuth, remova ou deixe vazias as variáveis: + * - GOOGLE_CLIENT_ID + * - GOOGLE_CLIENT_SECRET */ -export const googleSignInAvailable = Boolean( - process.env.NEXT_PUBLIC_GOOGLE_OAUTH_ENABLED -); +export const googleSignInAvailable = true; diff --git a/package.json b/package.json index 45e5b33..6081256 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "dev": "next dev --turbopack", "build": "next build", "start": "next start", - "lint": "next lint", "env:setup": "bash scripts/setup-env.sh", "db:generate": "drizzle-kit generate", "db:migrate": "drizzle-kit migrate",