Skip to content

Conversation

swolfand
Copy link
Collaborator

@swolfand swolfand commented Oct 8, 2025

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

  • Added AddConnectedAccountViewModel to manage the state and logic for connecting external accounts, including Google One Tap support and error handling.
  • Introduced UserProfileAddConnectedAccountView composable for displaying unconnected providers and linking new login options, with integration to the new ViewModel.

UI Improvements

  • Enhanced 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]
  • Updated preview of social login row to showcase multiple providers for better UI visualization.

Localization

  • Added new string resources for "Link another login option" and "Connect account" to improve clarity and localization support.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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

Comment on lines +36 to +39
user
.createExternalAccount(User.CreateExternalAccountParams(provider = provider))
.flatMap { it.reauthorize() }
.onSuccess { _state.value = State.Success }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@swolfand swolfand merged commit b3390e8 into sam/clerk-ui Oct 8, 2025
1 check passed
@swolfand swolfand deleted the sam/mobile-247-android-userprofileaddconnectedaccountview branch October 8, 2025 01:24
Copy link

github-actions bot commented Oct 8, 2025

❌ Paparazzi found snapshot diffs.

  • Download the paparazzi-report artifact from this workflow to see the HTML report and image diffs.
  • If the changes are expected, re-record locally and commit the updated golden images.

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.

1 participant