Show only the sign-in providers switched on in Supabase - #45
Merged
Merged
Conversation
A provider not yet enabled (Apple, here) still had a button, and pressing it left the person on Supabase's bare JSON 'provider is not enabled' page, which the app never sees. The login page now reads Auth's public settings (external.<provider>) and shows only what is on; with none, no buttons and no 'or' divider. Settings that cannot be read offer none — the email code still works. The invite hint mentions Apple's Share My Email only when the Apple button is there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ns6xSyytpwWuhH7vCJ8Dam
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Apple isn't enabled in the hosted Supabase project yet, but its button still showed. Pressing a disabled provider sends the browser to Supabase's
/authorize, which answers with a bare JSON page ({"code":400,"error_code":"validation_failed","msg":"Unsupported provider: provider is not enabled"}) on Supabase's domain. The app never sees that, so it can't explain it. Seen live for Google before it was enabled (auth log:provider is not enabledon/authorize).What
suite/lib/accounts/providers.ts:enabledProviders()reads Auth's public settings (GET /auth/v1/settingswith the anon key, the endpoint Supabase's docs use to check a provider is on) and returns the known providers whoseexternal.<id>istrue. It throws if the settings can't be read.console.warn) and the email code still works.docs/SELF-HOSTING.md: describes the new behaviour instead of the old error.No CSP change needed:
connect-srcalready allows the Supabase origin.Checks
enabledProviders(request shape, filtering, none, unreadable) and for the login page (one provider, none, unreadable, invite hint without Apple).tsc --noEmitpass locally.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ns6xSyytpwWuhH7vCJ8Dam
Generated by Claude Code