feat(google-auth): add forceAccountPicker option for explicit account selection#10
Merged
sbaiahmed1 merged 2 commits intomainfrom Dec 10, 2025
Merged
feat(google-auth): add forceAccountPicker option for explicit account selection#10sbaiahmed1 merged 2 commits intomainfrom
sbaiahmed1 merged 2 commits intomainfrom
Conversation
… selection - Introduced a new `forceAccountPicker` parameter to skip silent sign-in. - Updated iOS implementation to handle this behavior. - Documented the new option in the TypeScript interface.
Reviewer's GuideAdds an iOS-level forceAccountPicker option that, when configured, bypasses silent sign-in and always presents the Google account picker, and documents this option in the TypeScript configuration interface. Sequence diagram for iOS Google sign-in with forceAccountPickersequenceDiagram
actor User
participant ReactNativeApp
participant NativeModule
participant GoogleAuth
participant GIDSignIn
participant GoogleAccountPicker
User->>ReactNativeApp: Initiate_google_sign_in()
ReactNativeApp->>NativeModule: GoogleAuth_signIn()
NativeModule->>GoogleAuth: signIn(resolve, reject)
alt forceAccountPicker_enabled
GoogleAuth->>GoogleAuth: check_forceAccountPicker
GoogleAuth->>GoogleAccountPicker: performInteractiveSignIn(presentingViewController, resolve, reject)
GoogleAccountPicker-->>GoogleAuth: user_selected_account(user)
GoogleAuth->>NativeModule: resolve(user_data)
NativeModule->>ReactNativeApp: return_user_data
ReactNativeApp->>User: Show_signed_in_state
else forceAccountPicker_disabled
GoogleAuth->>GIDSignIn: restorePreviousSignIn(callback)
alt silent_sign_in_success
GIDSignIn-->>GoogleAuth: previous_user(user)
GoogleAuth->>NativeModule: resolve(user_data)
NativeModule->>ReactNativeApp: return_user_data
ReactNativeApp->>User: Show_signed_in_state
else silent_sign_in_failed_or_no_user
GIDSignIn-->>GoogleAuth: error_or_nil
GoogleAuth->>GoogleAccountPicker: performInteractiveSignIn(presentingViewController, resolve, reject)
GoogleAccountPicker-->>GoogleAuth: user_selected_account(user)
GoogleAuth->>NativeModule: resolve(user_data)
NativeModule->>ReactNativeApp: return_user_data
ReactNativeApp->>User: Show_signed_in_state
end
end
Updated class diagram for GoogleAuth and ConfigureParamsclassDiagram
class GoogleAuth {
<<objc_class>>
+static shared: GoogleAuth
-isConfigured: Bool
-configuredScopes: [String]
-forceAccountPicker: Bool
-init()
+configure(params: NSDictionary, resolve: RCTPromiseResolveBlock, reject: RCTPromiseRejectBlock)
+signIn(resolve: RCTPromiseResolveBlock, reject: RCTPromiseRejectBlock)
-performInteractiveSignIn(presentingViewController: UIViewController, resolve: RCTPromiseResolveBlock, reject: RCTPromiseRejectBlock)
-handleSignInSuccess(user: GIDGoogleUser, resolve: RCTPromiseResolveBlock)
-getPresentingViewController(): UIViewController
}
class ConfigureParams {
<<typescript_interface>>
+iosClientId: string
+webClientId: string
+scopes: string[]
+openIdRealm: string
+forceAccountPicker: boolean
}
ConfigureParams <.. GoogleAuth : used_for_configuration
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- The
forceAccountPickerflag is stored on the singleton at configuration time and then used for all subsequent sign-ins; consider making this a per-sign-in option (or resetting it after use) so one call withforceAccountPicker: truedoesn’t unintentionally affect all future calls. - The new
printstatements forforceAccountPickerchange runtime logging behavior; consider using a conditional or a dedicated logging mechanism so these messages don’t appear in production logs by default.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `forceAccountPicker` flag is stored on the singleton at configuration time and then used for all subsequent sign-ins; consider making this a per-sign-in option (or resetting it after use) so one call with `forceAccountPicker: true` doesn’t unintentionally affect all future calls.
- The new `print` statements for `forceAccountPicker` change runtime logging behavior; consider using a conditional or a dedicated logging mechanism so these messages don’t appear in production logs by default.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
…tion guide - Emphasized the requirement to use a Web OAuth client ID for `androidClientId`. - Added detailed instructions and notes for Google Cloud Console setup. - Updated troubleshooting section to address common configuration errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves: #9
resolves: #8
forceAccountPickerparameter to skip silent sign-in.