Add federated authentication support with GitHub and Google buttons#11
Conversation
|
Warning Review limit reached
Next review available in: 47 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (6)
📝 WalkthroughWalkthroughChangesThe PR adds a federated browser redirect session, removes password-recovery and sign-up actions from the quickstart login sheet, standardizes action identifier matching, and switches Google and GitHub buttons to drawable-based icons. Federated browser authentication
Authentication presentation updates
Provider icon rendering
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant AuthCaller
participant FederatedAuthSession
participant CustomTab
participant AppCallback
AuthCaller->>FederatedAuthSession: launch(context, redirectUrl)
FederatedAuthSession->>CustomTab: Open redirect URL
CustomTab->>AppCallback: Return callback deep-link
AppCallback->>FederatedAuthSession: onRedirect(uri)
FederatedAuthSession-->>AuthCaller: Return callback Uri
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@src/main/kotlin/dev/thunderid/android/auth/FederatedAuthSession.kt`:
- Around line 27-28: Update the launch flow in FederatedAuthSession so it
cancels any existing pending CompletableDeferred before assigning the newly
created deferred to pending. Preserve the current behavior for the first launch
and ensure the prior launch caller is released rather than orphaned when
launches overlap.
In
`@src/main/kotlin/dev/thunderid/compose/components/actions/adapters/GitHubButton.kt`:
- Around line 49-51: Remove trailing commas from the final arguments at the
Image and TriggerButtonStyle call sites in
src/main/kotlin/dev/thunderid/compose/components/actions/adapters/GitHubButton.kt
lines 49-51 and
src/main/kotlin/dev/thunderid/compose/components/actions/adapters/GoogleButton.kt
lines 49-51, specifically after Modifier.size(18.dp) and the closing content
block. No other call-site formatting changes are needed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: b26f5d20-48cc-4dc7-86c1-efa6fc6fb201
⛔ Files ignored due to path filters (2)
src/main/res/drawable-nodpi/ic_provider_github.pngis excluded by!**/*.pngsrc/main/res/drawable-nodpi/ic_provider_google.pngis excluded by!**/*.png
📒 Files selected for processing (6)
build.gradle.ktssamples/quickstart/src/main/kotlin/dev/thunderid/quickstart/AuthScreen.ktsrc/main/kotlin/dev/thunderid/android/auth/FederatedAuthSession.ktsrc/main/kotlin/dev/thunderid/compose/components/actions/adapters/GitHubButton.ktsrc/main/kotlin/dev/thunderid/compose/components/actions/adapters/GoogleButton.ktsrc/main/kotlin/dev/thunderid/compose/components/presentation/auth/SignIn.kt
35ae3d0 to
b8262f8
Compare
- Introduced `FederatedAuthSession` for handling browser redirects during federated login. - Added `ic_provider_github` and `ic_provider_google` drawable resources. - Updated `GitHubButton` and `GoogleButton` components to use images instead of custom drawings. - Simplified `AuthScreen` by removing unnecessary components and parameters.
Purpose
FederatedAuthSessionfor handling browser redirects during federated login.ic_provider_githubandic_provider_googledrawable resources.GitHubButtonandGoogleButtoncomponents to use images instead of custom drawings.AuthScreenby removing unnecessary components and parameters.Approach
N/A
Related Issues
Related PRs
Checklist
breaking changelabel added.Security checks
Summary by CodeRabbit
New Features
Bug Fixes
Changes