Skip to content

Show usermenu biometrics item also when not enrolled - #558

Open
WouterAms wants to merge 2 commits into
mainfrom
bug/AM-1014-toegang-met-face-id-button-tonen-onder-mijn-profiel
Open

Show usermenu biometrics item also when not enrolled#558
WouterAms wants to merge 2 commits into
mainfrom
bug/AM-1014-toegang-met-face-id-button-tonen-onder-mijn-profiel

Conversation

@WouterAms

@WouterAms WouterAms commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Changes

Test instructions

Other notes

GitHub Copilot was used in writing the code

@WouterAms
WouterAms requested review from a team and Copilot July 30, 2026 14:34
@github-actions github-actions Bot added the module:user Module touched based on changed src/modules folder(s). label Jul 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the User settings menu to display the biometrics navigation item whenever biometrics are supported on the device, even if the user has not enrolled biometrics yet.

Changes:

  • Stop using isEnrolled to decide whether to render the biometrics menu item.
  • Render the biometrics menu item as long as biometricsLabel is available.

Comment thread src/modules/user/components/UserMenu.tsx
@WouterAms
WouterAms requested a review from Copilot July 31, 2026 12:51
@github-actions github-actions Bot added module:access-code Module touched based on changed src/modules folder(s). Copilot ready All Copilot comments are resolved labels Jul 31, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

Suppressed comments (4)

src/modules/user/screens/UserBiometrics.screen.tsx:36

  • The nested if (!isEnrolled) inside if (!useBiometrics && !isEnrolled) is redundant; the outer condition already guarantees !isEnrolled. This adds unnecessary branching and makes the intent harder to read.
  const onChange = useCallback(() => {
    if (!useBiometrics && !isEnrolled) {
      if (!isEnrolled) {
        navigateToInstructionsScreen()
      }

      return
    }

src/modules/user/components/UserMenu.tsx:80

  • isBiometricsSupported is currently derived from biometricsLabel (!!biometricsLabel in useAccessCodeBiometrics), so checking both !biometricsLabel || !isBiometricsSupported is redundant and can hide the actual gating condition.
        {navigationItems.map(({icon, ...item}) =>
          item.route === UserRouteName.userBiometrics &&
          (!biometricsLabel || !isBiometricsSupported) ? null : (
            <NavigationButton

src/modules/access-code/hooks/useAccessCodeBiometrics.ts:84

  • updateUseBiometrics requests iOS Face ID permission and toggles the setting off when permission is denied, but it no longer provides a way for the UI to react (e.g., navigate to the biometrics instructions/settings screen). Previously the screen handled !granted by navigating; now the toggle can silently revert with no guidance for the user.
      if (
        Platform.OS === 'ios' &&
        biometricsAuthenticationType?.includes(
          AuthenticationType.FACIAL_RECOGNITION,
        )
      ) {
        const granted = await requestPermission()

        setUseBiometrics(granted)

        return
      }

src/hooks/useBiometrics.test.tsx:16

  • The test uses SecurityLevel.BIOMETRIC_STRONG, but the mocked SecurityLevel object does not define BIOMETRIC_STRONG. This makes the test run against undefined and can mask real behavior differences.
jest.mock('expo-local-authentication', () => ({
  authenticateAsync: jest.fn(),
  getEnrolledLevelAsync: jest.fn(),
  SecurityLevel: {
    NONE: 0,
    BIOMETRIC: 1,
  },
}))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Copilot ready All Copilot comments are resolved module:access-code Module touched based on changed src/modules folder(s). module:user Module touched based on changed src/modules folder(s).

Development

Successfully merging this pull request may close these issues.

3 participants