Repository navigation
Description
Bug description
After upgrading Supabase CLI from 2.92.0 to 2.98.2, OAuth sign-in with external providers (Google, GitHub) fails with a 400 validation_failed error instead of redirecting to the provider's authorization page.
In CLI 2.92.0 and earlier, leaving redirect_uri = "" in config.toml worked correctly — GoTrue inferred the redirect URI from site_url or the default API URL. In 2.98.2, this inference appears to be broken.
To Reproduce
- Configure OAuth in
supabase/config.tomlwith blankredirect_uri:
[auth]
site_url = "http://localhost:4200"
additional_redirect_urls = [
"http://localhost:4200",
"http://localhost:4200/auth/callback",
]
[auth.external.google]
enabled = true
client_id = "env(SUPABASE_AUTH_EXTERNAL_GOOGLE_CLIENT_ID)"
secret = "env(SUPABASE_AUTH_EXTERNAL_GOOGLE_SECRET)"
redirect_uri = ""
url = ""
skip_nonce_check = false- Set the required environment variables:
export SUPABASE_AUTH_EXTERNAL_GOOGLE_CLIENT_ID="your-google-client-id"
export SUPABASE_AUTH_EXTERNAL_GOOGLE_SECRET="your-google-secret"-
Run
supabase start -
Trigger OAuth authorization:
curl -v 'http://127.0.0.1:54321/auth/v1/authorize?provider=google&redirect_to=http%3A%2F%2Flocalhost%3A4200%2Fauth%2Fcallback'Actual result (CLI 2.98.2) ❌
HTTP/1.1 400 Bad Request
{
"code": 400,
"error_code": "validation_failed",
"msg": "Unsupported provider: missing redirect URI"
}Expected result (CLI 2.92.0) ✅
HTTP/1.1 302 Found
Location: https://accounts.google.com/o/oauth2/v2/auth?client_id=...&redirect_uri=http%3A%2F%2F127.0.0.1%3A54321%2Fauth%2Fv1%2Fcallback&...
Expected behavior
When redirect_uri is blank in config.toml, GoTrue should infer it from site_url or the default API URL (http://127.0.0.1:54321/auth/v1/callback), as it did in CLI 2.92.0.
System information
- OS: Windows 11
- CLI version: 2.98.2 (broken) vs 2.92.0 (works)
- Docker Desktop: latest
- supabase-js: 2.99.3
- Node.js: 22.x
Additional context
The auth container has the correct environment variables set:
GOTRUE_EXTERNAL_GOOGLE_ENABLED=true
GOTRUE_EXTERNAL_GOOGLE_CLIENT_ID=...
GOTRUE_EXTERNAL_GOOGLE_SECRET=...
GOTRUE_SITE_URL=http://localhost:4200
I verified that:
- Downgrading to CLI 2.92.0 fixes the issue immediately
- The
config.tomlhas not changed between versions - The env vars are loaded correctly by the CLI
I suspect a regression was introduced in how GoTrue validates the redirect_uri when it is empty. The change notes for 2.98.2 mention "fix: mailer links regression" but nothing about OAuth.
Regression range
- Last known good: 2.92.0
- First known bad: 2.98.2
I have not tested intermediate versions (2.93.x - 2.97.x) to narrow the exact version that introduced the regression.
Activity
singh-inder commentedon May 9, 2026
Hi @Snakeblack, this should be fixed in #5165
fix: set a fallback redirectUri for external provider (supabase#5165)