-
Notifications
You must be signed in to change notification settings - Fork 3
Add UserProfileAddConnectedAccountView #281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add UserProfileAddConnectedAccountView #281
Conversation
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
user | ||
.createExternalAccount(User.CreateExternalAccountParams(provider = provider)) | ||
.flatMap { it.reauthorize() } | ||
.onSuccess { _state.value = State.Success } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid reauthorizing right after connecting external account
For non‑Google providers createExternalAccount
already drives the external OAuth flow (via ExternalAccountService.connectExternalAccount
) and suspends until the account is linked. Chaining flatMap { it.reauthorize() }
immediately afterwards initiates a second reauthorization using the returned ExternalAccount
. When the initial connection succeeds, that object typically has a verified status and no externalVerificationRedirectUrl
, so ExternalAccount.reauthorize()
throws IllegalArgumentException("External verification redirect URL is null")
and the state remains stuck in Loading
. Users attempting to link a provider will see the flow crash or never complete. The reauthorize call should be removed or triggered only when the account actually requires reauthorization.
Useful? React with 👍 / 👎.
❌ Paparazzi found snapshot diffs.
|
Summary of changes
This pull request introduces a new feature for connecting external accounts to a user profile, improves the visual handling of social login buttons, and enhances UI preview and localization. The most significant changes include the addition of a dedicated ViewModel and UI for connecting accounts, improved error handling and fallback logic for social button icons, and better support for previewing and localizing the user experience.
New Feature: Connect External Accounts
AddConnectedAccountViewModel
to manage the state and logic for connecting external accounts, including Google One Tap support and error handling.UserProfileAddConnectedAccountView
composable for displaying unconnected providers and linking new login options, with integration to the new ViewModel.UI Improvements
ClerkSocialButton
icon logic: introduced fallback and error handling for provider logos, including a new globe icon for unknown providers and tinting for disabled states. [1] [2] [3]Localization