Skip to content

Sign in: a failed check keeps the button and says why; note Supabase's pooler for Vercel - #84

Merged
alisman merged 1 commit into
masterfrom
session/login
Oct 27, 2026
Merged

alisman merged 1 commit into
masterfrom
session/login

Conversation

@alisman

@alisman alisman commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Why

On 2026-10-27, signing in on https://cbiolab.vercel.app failed with getaddrinfo ENOTFOUND db.xfbxtkdzvetoorarmljw.supabase.co. Production's DATABASE_URL pointed at Supabase's direct host. That host is IPv6-only, and Vercel functions can only connect over IPv4.

Already fixed outside this PR: production's DATABASE_URL now uses the Supabase pooler (cohort_lab_app.<project>@aws-0-us-east-2.pooler.supabase.com:6543). The cohort_lab_app role has a new password, set with the same steps as db:app-role. Production was redeployed and reads Postgres again (/api/campaign returns campaigns).

This PR fixes the two weak spots the outage exposed.

Changes

  • The Sign in button no longer disappears silently. The header asks /api/auth once per page whether the deployment has sign-in. Before, if that request failed, enabled stayed false and the button simply wasn't drawn. The site looked like it had no login, with no error anywhere.
    • Now the failure is kept as authError. The button stays, and a click asks again.
    • If the check still fails, the sign-in dialog says what went wrong.
  • A failed uploads-list load no longer throws away the sign-in answer. Before, if a signed-in reader's uploads list failed to load (for example, the database was unreachable), the account menu vanished too.
  • docs/ENVIRONMENT.md now explains the pooler. On Vercel, DATABASE_URL must be Supabase's pooler, not db.<project>.supabase.co. The doc also says how to get db:app-role to write the pooler URL.

Verification

Tested against next dev with Playwright intercepting /api/auth:

  • Check always fails: the button is shown, and the dialog reads "Could not check how this site signs you in: the sign-in check answered 500 Internal Server Error".
  • Check fails once, then succeeds with Google sign-in: a click re-checks and goes to /api/auth/login?next=/lab.
  • Healthy, no login configured: the button is hidden, as before.

scripts/gate.sh passes: lint, unit tests, full e2e and warehouse checks.

Preview

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q3ezTZXsJbbkbA2BzPahCH

@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cbiolab-genie Ready Ready Preview Oct 27, 2026 8:22pm UTC
cohort-lab Ready Ready Preview Oct 27, 2026 8:22pm UTC

Request Review

…s pooler for Vercel

The header asks /api/auth once per page whether the deployment signs people in. When that
request failed, the error was recorded but `enabled` stayed false, so the Sign in button
silently disappeared and the site looked like it had no login at all. Likewise a signed-in
reader whose uploads list failed to load (e.g. the database unreachable) lost the account menu.

Now a failed check is kept apart as `authError`: the button stays, a click asks again, and if
it still can't tell, the sign-in dialog says what failed. The uploads list failing no longer
discards the sign-in answer.

docs/ENVIRONMENT.md: on Vercel, DATABASE_URL must be Supabase's IPv4 pooler, not the direct
db.<project>.supabase.co host, which is IPv6-only and fails with getaddrinfo ENOTFOUND.
That was the production outage of 2026-10-27.

Verified against next dev with /api/auth intercepted: always failing (button shown, dialog
names the 500), failing once then healthy (click re-checks and goes to /api/auth/login), and
healthy without login configured (button hidden, as before). scripts/gate.sh passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q3ezTZXsJbbkbA2BzPahCH
@alisman
alisman merged commit 0d592e7 into master Oct 27, 2026
16 of 17 checks passed
@alisman
alisman deleted the session/login branch October 27, 2026 20:57

This branch was successfully deployed

1 active deployment
Preview – cohort-lab — 35af46a7 Deployed Oct 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant