Skip to content

feat: drive SSO button visibility from server auth config#62

Merged
os-zhuang merged 2 commits into
mainfrom
claude/mobile-sso-button-config-Mlj1x
May 31, 2026
Merged

feat: drive SSO button visibility from server auth config#62
os-zhuang merged 2 commits into
mainfrom
claude/mobile-sso-button-config-Mlj1x

Conversation

@os-zhuang
Copy link
Copy Markdown
Contributor

$(cat <<'EOF'

Summary

  • SSO (Google, Apple, etc.) buttons on the sign-in and sign-up screens are now driven by the server's /api/v1/auth/config response instead of being hardcoded
  • Added lib/server-auth-config.ts with a typed fetchServerAuthConfig() function that fetches { socialProviders: string[] } from the server
  • Extended stores/server-store.ts to fetch and store ssoProviders on both hydrate (app start) and connect (server config screen)
  • Platform constraints (Apple Sign In only on iOS) are enforced client-side after the server list is applied
  • Unknown provider IDs fall back to a generic Continue with <id> label
  • Updated E2E test mock to supply ssoProviders: ["google"] from the server store

Test plan

  • Connect to a server that returns { "socialProviders": ["google"] } from /api/v1/auth/config — only the Google button appears
  • Connect to a server that returns { "socialProviders": ["google", "apple"] } — both buttons appear on iOS, only Google on Android
  • Connect to a server that returns { "socialProviders": [] } or whose endpoint returns non-OK — no SSO section renders at all
  • Existing email/password sign-in and sign-up flows are unaffected
  • E2E tests pass (jest __tests__/e2e/auth-flow.e2e.test.tsx)

https://claude.ai/code/session_014dJB1cy241fXfHdxg8MZbw
EOF
)


Generated by Claude Code

claude added 2 commits May 31, 2026 04:43
Instead of hardcoding Google/Apple buttons, fetch enabled social
providers from the server's /api/v1/auth/config endpoint on connect
and hydrate. The sign-in and sign-up screens now render only the
providers the server reports, filtered by platform support (e.g. Apple
only on iOS). Unknown providers fall back to a generic label.

https://claude.ai/code/session_014dJB1cy241fXfHdxg8MZbw
Cover fetchServerAuthConfig (all success and error branches) and
the server store's hydrate/connect/reset actions including the new
ssoProviders field. This fixes the ./stores/ coverage threshold that
was failing because server-store.ts had no tests.

https://claude.ai/code/session_014dJB1cy241fXfHdxg8MZbw
@os-zhuang os-zhuang marked this pull request as ready for review May 31, 2026 06:56
@os-zhuang os-zhuang merged commit 4e64e76 into main May 31, 2026
1 of 4 checks passed
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.

2 participants