Skip to content

feat(google-auth): add credentialManagerMode for customizable sign-in behaviour#18

Merged
sbaiahmed1 merged 1 commit intomainfrom
fix/issues-16
Jan 13, 2026
Merged

feat(google-auth): add credentialManagerMode for customizable sign-in behaviour#18
sbaiahmed1 merged 1 commit intomainfrom
fix/issues-16

Conversation

@sbaiahmed1
Copy link
Copy Markdown
Owner

@sbaiahmed1 sbaiahmed1 commented Jan 13, 2026

resolves: #16

  • Introduced credentialManagerMode to control sign-in on Android
  • Updated Android implementation to handle the new parameter with validation
  • Documented the credentialManagerMode option in the TypeScript interface

Summary by CodeRabbit

  • New Features
    • Added credentialManagerMode configuration option to control Android sign-in flow behavior.
    • Three modes available: silent (silent attempts only), interactive (always interactive), and auto (silent first with interactive fallback).
    • Defaults to "auto" mode, preserving existing sign-in behavior.

✏️ Tip: You can customize this high-level summary in your review settings.

… behavior

- Introduced `credentialManagerMode` to control sign-in on Android
- Updated Android implementation to handle the new parameter with validation
- Documented the `credentialManagerMode` option in the TypeScript interface
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 13, 2026

📝 Walkthrough

Walkthrough

Introduces a new credentialManagerMode configuration parameter for Android Credential Manager sign-in with three modes: silent (no UI), interactive (always UI), and auto (silent-first fallback). The parameter is added to TypeScript type definitions and implemented in the Android module with mode-specific control flows.

Changes

Cohort / File(s) Summary
TypeScript Configuration Types
src/NativeGoogleAuth.ts
Added optional credentialManagerMode?: 'silent' | 'interactive' | 'auto' field to ConfigureParams interface with documentation describing Android platform behavior
Android Sign-In Implementation
android/src/main/java/com/googleauth/GoogleAuthModule.kt
Introduced credentialManagerMode property with validation; replaced single sign-in path with three-mode flow (silent only, interactive only, auto with fallback); adjusted error handling and logging per mode

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Module as GoogleAuthModule
    participant CredMgr as Credential Manager
    participant IdP as Google IdP

    Client->>Module: configure(credentialManagerMode)
    Module->>Module: validate mode
    
    rect rgb(200, 220, 255)
    Note over Client,IdP: Silent Mode
    Client->>Module: signIn()
    Module->>CredMgr: GetGoogleIdOption (silent)
    CredMgr-->>Module: error (no credential)
    Module-->>Client: SIGN_IN_ERROR
    end
    
    rect rgb(220, 200, 255)
    Note over Client,IdP: Interactive Mode
    Client->>Module: signIn()
    Module->>CredMgr: GetSignInWithGoogleOption
    CredMgr->>IdP: show account picker
    IdP-->>CredMgr: credential
    CredMgr-->>Module: credential
    Module-->>Client: success
    end
    
    rect rgb(200, 255, 220)
    Note over Client,IdP: Auto Mode (Default)
    Client->>Module: signIn()
    Module->>CredMgr: GetGoogleIdOption (silent)
    alt credential found
    CredMgr-->>Module: credential
    Module-->>Client: success
    else credential not found
    Module->>CredMgr: GetSignInWithGoogleOption
    CredMgr->>IdP: show account picker
    IdP-->>CredMgr: credential
    CredMgr-->>Module: credential
    Module-->>Client: success
    end
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Three paths unfold where sign-ins dance,
Silent whispers, or the interactive glance,
Auto tries its gentle way first,
Then gives the UI the quench for thirst!
Config flows through, no breaking change—
Credential Manager's got a brand new range! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main feature: adding credentialManagerMode to enable customizable sign-in behavior, which is the core objective.
Linked Issues check ✅ Passed All coding requirements from issue #16 are met: credentialManagerMode parameter is exposed to TypeScript, three modes (silent/interactive/auto) are implemented with correct behavior, and Credential Manager remains the default approach.
Out of Scope Changes check ✅ Passed All changes are directly aligned with issue #16 requirements: TypeScript interface addition and Android implementation modifications for the credentialManagerMode feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9e1a85a and 32af4cd.

⛔ Files ignored due to path filters (1)
  • example/ios/Podfile.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • android/src/main/java/com/googleauth/GoogleAuthModule.kt
  • src/NativeGoogleAuth.ts
🔇 Additional comments (4)
src/NativeGoogleAuth.ts (1)

121-130: LGTM!

The new credentialManagerMode configuration option is well-documented with clear descriptions for each mode. The string union type provides good type safety, and marking it as optional with a documented default of 'auto' maintains backward compatibility.

android/src/main/java/com/googleauth/GoogleAuthModule.kt (3)

49-49: LGTM!

Property is correctly initialized with "auto" as the default, consistent with the TypeScript documentation.


129-137: LGTM!

The extraction properly defaults to "auto" when not specified, and the validation correctly rejects invalid values with a clear error message before proceeding with configuration.


205-242: Well-structured mode-based sign-in implementation.

The three-mode control flow correctly implements the specified behavior:

  • silent: Fails fast with a descriptive error when no credentials exist
  • interactive: Always shows the account picker UI
  • auto: Silent-first with interactive fallback

The asymmetric error handling between modes is appropriate—silent mode needs specific messaging about "no saved credentials" vs. the interactive mode where the outer catch provides adequate error context.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sbaiahmed1 sbaiahmed1 merged commit c6ab417 into main Jan 13, 2026
6 checks passed
@sbaiahmed1 sbaiahmed1 deleted the fix/issues-16 branch January 13, 2026 22:08
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.

Make Credential Manager interactive behavior configurable (silent vs interactive)

1 participant