docs(auth): guia passo-a-passo de ativação SSO pré-deploy (F1-1.x)#105
Conversation
Complemento direto do PR #104 (cleanup/remove-lovable-auth). Documento detalha como ativar SSO Google em produção via Supabase nativo, em ~30min, sem precisar de código novo: 1. Criar OAuth Client ID no Google Cloud (passo 1) 2. Configurar redirect URIs (passo 2) 3. Habilitar provider Google no Supabase (passo 3) 4. Variáveis de ambiente (sanidade) (passo 4) 5. Smoke test manual (passo 5) 6. Apple Sign-In (opcional, passo 6) — requer implementar botão na UI primeiro Inclui troubleshooting (erros comuns + solução) e procedimento de rollback em 30 segundos (toggle Supabase) ou 1 linha de código (esconder botão). **Risk**: zero (apenas documentação, nenhum código alterado). **Test plan**: revisão manual do conteúdo + verificação dos links externos (Supabase docs, Google docs).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Warning
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5cd4f6d523
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ``` | ||
| https://promogifts.com.br/auth/callback | ||
| https://www.promogifts.com.br/auth/callback | ||
| https://app.promogifts.com.br/auth/callback |
There was a problem hiding this comment.
Don't advertise app domain until it uses Supabase OAuth
If production is served from app.promogifts.com.br, following this runbook still won't enable the documented Supabase Google flow: src/components/auth/SocialLoginButtons.tsx only treats *.atomicabr.com.br, promogifts.com.br, and www.promogifts.com.br as self-hosted, so app.promogifts.com.br falls through to the Lovable broker instead of supabase.auth.signInWithOAuth. This domain should either be removed from the activation guide or the routing predicate should include it before operators rely on this checklist.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
Adds a new operational runbook to guide pre-deploy activation of Google SSO (Supabase Auth) in production, intended to close the “SSO activation” gap after the Lovable Auth removal work.
Changes:
- Adds
docs/AUTH-SSO-ACTIVATION.mdwith a step-by-step checklist for Google OAuth setup (Google Cloud Console → Supabase → smoke test). - Documents rollback options and a troubleshooting table for common auth errors.
- Includes an optional section outlining what would be needed to add Apple Sign-In.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,236 @@ | |||
| # 🔐 Ativação SSO em Produção — Guia Pré-Deploy | |||
|
|
|||
| **Status:** SSO desabilitado em código. Login social (botão "Continuar com Google") está visível na UI mas vai retornar erro `Provider not enabled` até este guia ser executado. | |||
| ## Passo 2 — Redirect URIs adicionais | ||
|
|
||
| Se a Promo Brindes for usar **subdomínios diferentes em produção**, adicione cada um na lista de `Authorized redirect URIs` do Google + também configure na lista de `Site URL` do Supabase (Passo 3). | ||
|
|
||
| Exemplos comuns que talvez precisem entrar: | ||
| - `https://promo-gifts-staging.atomicabr.com.br` (staging) | ||
| - `https://promo-gifts-pr-*.vercel.app` (Vercel preview deploys — opcional, pode usar wildcard) | ||
|
|
| | `redirect_to is not allowed` | URL atual não está em Redirect URLs | Adicionar em Supabase URL Config | | ||
| | `redirect_uri_mismatch` (na tela do Google) | URL atual não está em Authorized redirect URIs do Google | Adicionar em Google Cloud Console | | ||
| | `Sessão não estabelecida` (toast no app, após 8s) | OAuth callback funcionou mas Supabase não conseguiu trocar code por session | Ver logs do Supabase Auth | | ||
| | Loop redirect infinito | `Site URL` mal configurado no Supabase | Confirmar que `Site URL` é só a raiz, sem `/auth/callback` | |
| ⚠️ **Apple Sign-In NÃO está implementado na UI do PromoGifts atualmente.** Existe apenas como tipo no SDK que removemos. Pra ativar, é preciso: | ||
|
|
Plano
Adiciona
docs/AUTH-SSO-ACTIVATION.md(236 linhas) — complemento direto do PR #104 que removeu Lovable Auth.Documento serve como runbook pra ativar SSO Google em produção em ~30min, executável por qualquer pessoa com acesso ao painel Supabase + Google Cloud Console.
Conteúdo
Decisões refletidas no documento
Risk
🟢 Zero. Apenas documentação. Nenhum código alterado.
Test plan
Próximos PRs relacionados
Junto com #104 (
cleanup/remove-lovable-auth), este PR fecha o GAP de auth identificado na auditoria de Maio/2026.Outros PRs em aberto:
cleanup/files-zumbi(arquivos gerados versionados)chore/fix-coderabbit-config(rebased em main)