Skip to content

fix: allow custom title and cancel button text for secure credentials#90

Open
Vlodzimej wants to merge 2 commits into
Cap-go:mainfrom
Vlodzimej:android-custom-secure-credentials-text
Open

fix: allow custom title and cancel button text for secure credentials#90
Vlodzimej wants to merge 2 commits into
Cap-go:mainfrom
Vlodzimej:android-custom-secure-credentials-text

Conversation

@Vlodzimej

@Vlodzimej Vlodzimej commented May 13, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • New Features
    • Biometric prompts on Android now allow customizing the dialog title and the negative button text via options. Sensible defaults ("Protect Credentials" and "Cancel") are used when values aren’t provided, preserving existing behavior otherwise.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The PR extends the biometric authentication plugin's configuration interface to allow customization of authentication dialog labels. The BiometricOptions interface gains two optional fields, and the Android native credential-setting code is updated to use these new fields from the incoming plugin call instead of hardcoded strings.

Changes

Customizable Auth UI Text Configuration

Layer / File(s) Summary
Auth UI Text Options Contract and Implementation
src/definitions.ts, android/src/main/java/ee/forgr/biometric/NativeBiometric.java
BiometricOptions interface declares title and negativeButtonText as optional string fields; Android setCredentials() reads these fields from PluginCall with defaults ("Protect Credentials" and "Cancel") and passes them to the AuthActivity intent.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A biometric tale, so neat and true,
Where titles and buttons get their due,
No more hardcoded strings to bind,
Just flexible text, the helpful kind! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding customizable title and cancel button text for the secure credentials Android feature.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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


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.

@github-actions

Copy link
Copy Markdown

Beta npm build

This PR comes from a fork, so beta publish is disabled for security.

If you need a beta package, move the branch into this repository first.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/definitions.ts`:
- Around line 165-166: SetCredentialOptions added two new public optional
properties (title and negativeButtonText) that lack JSDoc; add short JSDoc
comments above each property in the SetCredentialOptions interface describing
their purpose, expected type/format, and any default/behavior (e.g., title:
string shown on prompt; negativeButtonText: string label for cancel/negative
action) so docgen will include them in the API docs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dd48cd8d-652d-417e-8093-fb5d738665ef

📥 Commits

Reviewing files that changed from the base of the PR and between 3e649a3 and ef843b0.

📒 Files selected for processing (2)
  • android/src/main/java/ee/forgr/biometric/NativeBiometric.java
  • src/definitions.ts

Comment thread src/definitions.ts
@Vlodzimej Vlodzimej force-pushed the android-custom-secure-credentials-text branch from ef843b0 to c7d72fe Compare May 25, 2026 07:44

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@android/src/main/java/ee/forgr/biometric/NativeBiometric.java`:
- Around line 286-287: NativeBiometric.setCredentials currently forwards raw
strings from the PluginCall into the Intent extras ("title" and
"negativeButtonText") which can be empty/blank and cause AuthActivity's
BiometricPrompt.PromptInfo.Builder.build() to throw; update setCredentials to
normalize blank/whitespace-only values to the intended defaults before calling
intent.putExtra (e.g., treat "" or all-whitespace as null or use the default
strings "Protect Credentials"/"Cancel"), referencing
NativeBiometric.setCredentials, the "title"/"negativeButtonText" intent extras,
AuthActivity, and BiometricPrompt.PromptInfo.Builder.build to locate the code to
change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 20f88f02-7a44-4b35-a189-6aeadbb1e3e5

📥 Commits

Reviewing files that changed from the base of the PR and between ef843b0 and c7d72fe.

📒 Files selected for processing (2)
  • android/src/main/java/ee/forgr/biometric/NativeBiometric.java
  • src/definitions.ts

Comment thread android/src/main/java/ee/forgr/biometric/NativeBiometric.java
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