Skip to content

Version 10.0.0 beta03#2315

Draft
russellwheatley wants to merge 2 commits intomasterfrom
version-10.0.0-beta03
Draft

Version 10.0.0 beta03#2315
russellwheatley wants to merge 2 commits intomasterfrom
version-10.0.0-beta03

Conversation

@russellwheatley
Copy link
Copy Markdown
Member

@russellwheatley russellwheatley commented Apr 17, 2026

Description

demolaf and others added 2 commits April 9, 2026 16:26
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the authentication flow to support direct navigation to a specific provider's screen when only one provider is configured, bypassing the method picker. It introduces extension functions in a new UserUtils.kt file for consistent user identification, improves the reliability of authStateFlow by incorporating an IdTokenListener to handle account linking, and updates navigation logic and tests to reflect these changes. The review feedback suggests using the user instance provided by the AuthState object directly in the UI layer for better consistency and idiomatic code.

is AuthState.Success -> {
val user = uiContext.authUI.getCurrentUser()
val identifier = user?.email ?: user?.phoneNumber ?: user?.uid.orEmpty()
val identifier = user.displayIdentifier()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Since the state is already smart-cast to AuthState.Success in this block, you can use state.user directly instead of relying on the user variable retrieved from authUI.getCurrentUser(). This is more idiomatic as it ensures you are using the specific user instance that triggered the current state emission.

Suggested change
val identifier = user.displayIdentifier()
val identifier = state.user.displayIdentifier()


is AuthState.RequiresEmailVerification -> {
val email = uiContext.authUI.getCurrentUser()?.email ?: stringProvider.emailProvider
val email = uiContext.authUI.getCurrentUser().getDisplayEmail(stringProvider.emailProvider)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

In the AuthState.RequiresEmailVerification block, you can use state.user directly instead of calling uiContext.authUI.getCurrentUser(). Using the data provided by the state object is safer and more consistent with Compose state management patterns.

Suggested change
val email = uiContext.authUI.getCurrentUser().getDisplayEmail(stringProvider.emailProvider)
val email = state.user.getDisplayEmail(stringProvider.emailProvider)

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