Add apple sso continue button - #141
Conversation
Renders the apple SSO provider on the login, signup and invite screens, gated to Apple devices only (iOS Capacitor shell via mobilePlatform(), otherwise Mac/iPhone/iPad user agents) through the new isApplePlatform() predicate and its hydration-safe useIsApplePlatform() hook. Clickability still follows the provider list the backend returns, same as Google and Microsoft. Needs the core-lib AuthSsoProvider 'apple' support (hotfix/apple-sso-auth-forms in openframe-oss-lib). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughApple SSO support was added to shared authentication contracts and to login, signup, registration, and invitation flows. Apple providers are detected and exposed only on Apple platforms. The platform check is hydration-safe. ChangesApple SSO authentication
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Browser
participant LoginPage
participant useIsApplePlatform
participant Backend
Browser->>LoginPage: open login page
LoginPage->>useIsApplePlatform: read platform state
useIsApplePlatform-->>LoginPage: return Apple platform boolean
LoginPage->>Backend: request available SSO providers
Backend-->>LoginPage: return configured providers
LoginPage-->>Browser: render filtered SSO providers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/lib/platform.ts (1)
82-93: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd regression coverage for all Apple-platform branches.
This helper controls whether the Apple SSO button is rendered. Test SSR, Capacitor iOS, Capacitor Android, macOS, iOS/iPadOS user agents, and a non-Apple user agent.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/lib/platform.ts` around lines 82 - 93, Add regression tests for isApplePlatform covering SSR, Capacitor iOS, Capacitor Android, macOS, iOS/iPadOS user agents, and a non-Apple user agent. Mock the relevant window, user-agent, isMobileShell, and mobilePlatform conditions so both the mobile-shell and browser branches return the expected boolean values.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/lib/platform.ts`:
- Around line 82-93: Add regression tests for isApplePlatform covering SSR,
Capacitor iOS, Capacitor Android, macOS, iOS/iPadOS user agents, and a non-Apple
user agent. Mock the relevant window, user-agent, isMobileShell, and
mobilePlatform conditions so both the mobile-shell and browser branches return
the expected boolean values.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 82c8680c-fb8b-49c0-92a8-b89b16e2e8be
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (9)
package.jsonsrc/app/(auth)/auth/hooks/use-auth.tssrc/app/(auth)/auth/invite/page.tsxsrc/app/(auth)/auth/pages/auth-page.tsxsrc/app/(auth)/auth/pages/login-page.tsxsrc/app/(auth)/auth/pages/signup-page.tsxsrc/app/hooks/use-apple-platform.tssrc/lib/auth-api-client.tssrc/lib/platform.ts
Summary by CodeRabbit