Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Skip unneeded confirmation button after successful authentication with face unlock #550

Open
victor-marino opened this issue Dec 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@victor-marino
Copy link

Is your feature request related to a problem? Please describe.

When using a phone with face unlock (e.g.: Pixel 8 or Pixel 9), the user is not automatically taken to the app after successful authentication. Instead, they're required to tap a "Confirm" button.

I can't take a screenshot of the biometric prompt, but here's an example from the Android docs:

face_unlock_confirm

The reason is that on Android, biometric prompts are created as "sensitive" by default unless specified otherwise. This is fine for high-risk operations, such as confirming a purchase, but it doesn't make sense for low-risk actions like logging into an app. To avoid this step and provide a smooth user experience, biometric prompts should be marked as non-sensitive.

Describe the solution you'd like

The fix is extremely simple.

In Flutter, all that needs to be done is pass the sensitiveTransaction: false flag when creating the biometric prompt in line 48 of initializeBiometrics.dart, as indicated in the local_auth docs:

if (authAvailable) {
  //bool biometricsOnly = (await auth.canCheckBiometrics);
  return (await auth.authenticate(
    localizedReason: "verify-identity".tr(),
-    options: AuthenticationOptions(biometricOnly: false),
+    options: AuthenticationOptions(biometricOnly: false, sensitiveTransaction: false),
  ))
      ? AuthResult.authenticated
      : AuthResult.unauthenticated;
}

Once this change is done the authentication flow will work as intended when using face unlock: the user will briefly see the face unlock indicator, then they will be taken straight to the app. I can confirm apps also "feel" much faster when this is implemented properly, even though this has nothing to do with the performance of the app itself :-)

@victor-marino victor-marino added the enhancement New feature or request label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant