-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[No QA] [ECUK In-App 3DS] Add BIOMETRICS_TEST scenario screens & routes + add test biometrics button to the troubleshoot menu
#79475
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
Merged
rafecolton
merged 5 commits into
Expensify:main
from
software-mansion-labs:korytko/ecuk/3ds/add-biometrics-test-screens-and-routes
Jan 19, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
13c2f3c
feat: add basic multifactor authentication components
JakubKorytko 70eb1a4
feat: add basic multifactor authentication pages
JakubKorytko 7fc8d28
feat: add test biometrics button to test tool menu
JakubKorytko 0647a00
fix: address PR comments
jakubkalinski0 fd89257
fix: address Rafe PR comments
jakubkalinski0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/components/MultifactorAuthentication/NoEligibleMethodsDescription.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import Text from '@components/Text'; | ||
| import TextLink from '@components/TextLink'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import goToSettings from '@libs/goToSettings'; | ||
|
|
||
| const baseTranslationPath = 'multifactorAuthentication.pleaseEnableInSystemSettings' as const; | ||
|
|
||
| const translationPaths = { | ||
| start: `${baseTranslationPath}.start`, | ||
| link: `${baseTranslationPath}.link`, | ||
| end: `${baseTranslationPath}.end`, | ||
| } as const; | ||
|
|
||
| function NoEligibleMethodsDescription() { | ||
| const styles = useThemeStyles(); | ||
| const {translate} = useLocalize(); | ||
|
|
||
| const start = translate(translationPaths.start); | ||
| const link = translate(translationPaths.link); | ||
| const end = translate(translationPaths.end); | ||
|
|
||
| return ( | ||
| <Text style={[styles.textAlignCenter, styles.textSupporting]}> | ||
JakubKorytko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| {start} | ||
| <TextLink onPress={goToSettings}>{link}</TextLink> | ||
| {end} | ||
| </Text> | ||
| ); | ||
| } | ||
|
|
||
| NoEligibleMethodsDescription.displayName = 'NoEligibleMethodsDescription'; | ||
|
|
||
| export default NoEligibleMethodsDescription; | ||
38 changes: 38 additions & 0 deletions
38
src/components/MultifactorAuthentication/PromptContent.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import React from 'react'; | ||
| import {View} from 'react-native'; | ||
| import BlockingView from '@components/BlockingViews/BlockingView'; | ||
| import type DotLottieAnimation from '@components/LottieAnimations/types'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import type {TranslationPaths} from '@src/languages/types'; | ||
|
|
||
| type MultifactorAuthenticationPromptContentProps = { | ||
| animation: DotLottieAnimation; | ||
| title: TranslationPaths; | ||
| subtitle: TranslationPaths; | ||
| }; | ||
|
|
||
| function MultifactorAuthenticationPromptContent({title, subtitle, animation}: MultifactorAuthenticationPromptContentProps) { | ||
| const styles = useThemeStyles(); | ||
| const {translate} = useLocalize(); | ||
|
|
||
| return ( | ||
| <View style={styles.flex1}> | ||
| <BlockingView | ||
| animation={animation} | ||
JakubKorytko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| animationStyles={styles.mfaBlockingViewAnimation} | ||
| animationWebStyle={styles.mfaBlockingViewAnimation} | ||
| title={translate(title)} | ||
| titleStyles={styles.mb2} | ||
| subtitle={translate(subtitle)} | ||
| subtitleStyle={styles.textSupporting} | ||
| containerStyle={styles.ph5} | ||
| testID="MultifactorAuthenticationPromptContent" | ||
| /> | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
| MultifactorAuthenticationPromptContent.displayName = 'MultifactorAuthenticationPromptContent'; | ||
|
|
||
| export default MultifactorAuthenticationPromptContent; | ||
45 changes: 45 additions & 0 deletions
45
src/components/MultifactorAuthentication/TriggerCancelConfirmModal.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import React from 'react'; | ||
| import ConfirmModal from '@components/ConfirmModal'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import type {TranslationPaths} from '@src/languages/types'; | ||
|
|
||
| type MultifactorAuthenticationTriggerCancelConfirmModalProps = { | ||
| isVisible: boolean; | ||
| onConfirm: () => void; | ||
| onCancel: () => void; | ||
| }; | ||
|
|
||
| // TODO: this config will be part of the scenario configuration, the current implementation is for testing purposes (https://github.com/Expensify/App/issues/79373) | ||
| const mockedConfig = { | ||
JakubKorytko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| title: 'common.areYouSure', | ||
| description: 'multifactorAuthentication.biometricsTest.areYouSureToReject', | ||
| confirmButtonText: 'multifactorAuthentication.biometricsTest.rejectAuthentication', | ||
| cancelButtonText: 'common.cancel', | ||
| } as const satisfies Record<string, TranslationPaths>; | ||
|
|
||
| function MultifactorAuthenticationTriggerCancelConfirmModal({isVisible, onConfirm, onCancel}: MultifactorAuthenticationTriggerCancelConfirmModalProps) { | ||
| const {translate} = useLocalize(); | ||
|
|
||
| const title = translate(mockedConfig.title); | ||
| const description = translate(mockedConfig.description); | ||
| const confirmButtonText = translate(mockedConfig.confirmButtonText); | ||
| const cancelButtonText = translate(mockedConfig.cancelButtonText); | ||
|
|
||
| return ( | ||
| <ConfirmModal | ||
| danger | ||
| title={title} | ||
| onConfirm={onConfirm} | ||
| onCancel={onCancel} | ||
| isVisible={isVisible} | ||
| prompt={description} | ||
| confirmText={confirmButtonText} | ||
| cancelText={cancelButtonText} | ||
| shouldShowCancelButton | ||
| /> | ||
| ); | ||
| } | ||
|
|
||
| MultifactorAuthenticationTriggerCancelConfirmModal.displayName = 'MultifactorAuthenticationTriggerCancelConfirmModal'; | ||
|
|
||
| export default MultifactorAuthenticationTriggerCancelConfirmModal; | ||
84 changes: 84 additions & 0 deletions
84
src/components/MultifactorAuthentication/ValidateCodeResendButton.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| import React, {useCallback, useImperativeHandle, useRef, useState} from 'react'; | ||
| import {View} from 'react-native'; | ||
| import PressableWithFeedback from '@components/Pressable/PressableWithFeedback'; | ||
| import Text from '@components/Text'; | ||
| import ValidateCodeCountdown from '@components/ValidateCodeCountdown'; | ||
| import type {ValidateCodeCountdownHandle} from '@components/ValidateCodeCountdown/types'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import useNetwork from '@hooks/useNetwork'; | ||
| import useStyleUtils from '@hooks/useStyleUtils'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import CONST from '@src/CONST'; | ||
| import type {TranslationPaths} from '@src/languages/types'; | ||
|
|
||
| type MultifactorAuthenticationValidateCodeResendButtonHandle = { | ||
| resetCountdown: () => void; | ||
| }; | ||
|
|
||
| type MultifactorAuthenticationValidateCodeResendButtonProps = { | ||
| ref?: React.Ref<MultifactorAuthenticationValidateCodeResendButtonHandle>; | ||
| shouldDisableResendCode: boolean; | ||
| hasError: boolean; | ||
| resendButtonText: TranslationPaths; | ||
| onResendValidationCode: () => void; | ||
| }; | ||
|
|
||
| function MultifactorAuthenticationValidateCodeResendButton({ | ||
JakubKorytko marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ref, | ||
| shouldDisableResendCode, | ||
| hasError, | ||
| resendButtonText, | ||
| onResendValidationCode, | ||
| }: MultifactorAuthenticationValidateCodeResendButtonProps) { | ||
| const styles = useThemeStyles(); | ||
| const StyleUtils = useStyleUtils(); | ||
| const {translate} = useLocalize(); | ||
| const {isOffline} = useNetwork(); | ||
|
|
||
| const [isCountdownRunning, setIsCountdownRunning] = useState(true); | ||
| const countdownRef = useRef<ValidateCodeCountdownHandle>(null); | ||
|
|
||
| const handleCountdownFinish = useCallback(() => { | ||
| setIsCountdownRunning(false); | ||
| }, []); | ||
|
|
||
| useImperativeHandle(ref, () => ({ | ||
| resetCountdown: () => { | ||
| countdownRef.current?.resetCountdown(); | ||
| setIsCountdownRunning(true); | ||
| }, | ||
| })); | ||
|
|
||
| return ( | ||
| <View style={styles.alignItemsStart}> | ||
| {isCountdownRunning && !isOffline ? ( | ||
| <View style={[styles.mt5, styles.flexRow, styles.renderHTML]}> | ||
| <ValidateCodeCountdown | ||
| ref={countdownRef} | ||
| onCountdownFinish={handleCountdownFinish} | ||
| /> | ||
| </View> | ||
| ) : ( | ||
| <PressableWithFeedback | ||
| style={styles.mt5} | ||
| onPress={onResendValidationCode} | ||
| disabled={shouldDisableResendCode} | ||
| hoverDimmingValue={1} | ||
| pressDimmingValue={0.2} | ||
| role={CONST.ROLE.BUTTON} | ||
| accessibilityLabel={translate(resendButtonText)} | ||
| > | ||
| <Text style={[StyleUtils.getDisabledLinkStyles(shouldDisableResendCode)]}> | ||
| {hasError ? translate('validateCodeForm.requestNewCodeAfterErrorOccurred') : translate(resendButtonText)} | ||
| </Text> | ||
| </PressableWithFeedback> | ||
| )} | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
| MultifactorAuthenticationValidateCodeResendButton.displayName = 'MultifactorAuthenticationValidateCodeResendButton'; | ||
|
|
||
| export default MultifactorAuthenticationValidateCodeResendButton; | ||
|
|
||
| export type {MultifactorAuthenticationValidateCodeResendButtonHandle}; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.