Skip to content

Unnecessary biometryLockout UI handling in LocalAuthPlugin.swift #173142

Closed
flutter/packages
#9981

Description

@okorohelijah

The current implementation attempts to show a custom alert when biometrics are locked out after too many failed attempts:

https://github.com/flutter/packages/blob/main/packages/local_auth/local_auth_darwin/darwin/local_auth_darwin/Sources/local_auth_darwin/LocalAuthPlugin.swift#L384-L391

The Issue

Based on Apple's official documentation and the observed behavior on modern iOS devices, the operating system already handles the UI for biometric lockout. When Touch ID or Face ID is locked, iOS presents its own system-level alert and prompts the user to enter their passcode.

Because the system manages this UI, the custom showAlert in the Flutter code is never displayed to the user, making this block of code effectively dead or unreachable.

Expected Behavior

The app should rely on the native iOS handling for biometric lockouts. No custom alert should be necessary.

Proposal

I suggest removing the case .biometryLockout and its associated showAlert call. This will clean up the codebase by removing redundant code and align the plugin's behavior with the standard, native iOS user experience.

IMG_7855.mov

Activity

  1. added
    packageflutter/packages repository. See also p: labels.
    team-iosOwned by iOS platform team
    on Aug 1, 2025
  2. stuartmorgan-g commented on Aug 2, 2025

    @stuartmorgan-g
    Contributor

    In the video, you are tapping the regular authentication button, which corresponds to using the .deviceOwnerAuthentication. The docs for this error code are:

    A passcode is now required to unlock biometry. Try the LAPolicy.deviceOwnerAuthentication policy instead to allow use of a passcode.

    I.e., it's only intended to be returned when using .deviceOwnerAuthenticationWithBiometrics instead of deviceOwnerAuthentication. In local_auth, that's biometricOnly = true, which is the last button in the UI.

    making this block of code effectively dead or unreachable.

    I would expect that the other button will still hit this codepath. (If it were impossible to ever get this error code in modern versions of iOS, Apple would normally have deprecated the enum value, as they have in the past with other enum values that their SDKs can no longer return.)

  3. added
    P2Important issues not at the top of the work list
    triaged-iosTriaged by iOS platform team
    on Aug 7, 2025
  4. github-actions commented on Oct 30, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  5. locked as resolved and limited conversation to collaborators on Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P2Important issues not at the top of the work listp: local_authPlugin for local authentificationpackageflutter/packages repository. See also p: labels.platform-iosiOS applications specificallyplatform-macosBuilding on or for macOS specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions