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

[INJIMOB-2576] fix app lockout issue when app exited in passcode screen. #1752

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions machines/auth.typegen.ts
Original file line number Diff line number Diff line change
@@ -1,51 +0,0 @@

// This file was automatically generated. Edits will be overwritten

export interface Typegen0 {
'@@xstate/typegen': true;
internalEvents: {
"": { type: "" };
"done.invoke.auth.authorized:invocation[0]": { type: "done.invoke.auth.authorized:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"done.invoke.auth.introSlider:invocation[0]": { type: "done.invoke.auth.introSlider:invocation[0]"; data: unknown; __tip: "See the XState TS docs to learn how to strongly type this." };
"xstate.init": { type: "xstate.init" };
};
invokeSrcNameMap: {
"downloadFaceSdkModel": "done.invoke.auth.authorized:invocation[0]";
"generatePasscodeSalt": "done.invoke.auth.introSlider:invocation[0]";
};
missingImplementations: {
actions: never;
delays: never;
guards: never;
services: never;
};
eventsCausingActions: {
"requestStoredContext": "xstate.init";
"setBiometrics": "SETUP_BIOMETRICS";
"setContext": "STORE_RESPONSE";
"setInitialDownloadDone": "INITIAL_DOWNLOAD_DONE";
"setIsToggleFromSettings": "CHANGE_METHOD";
"setLanguage": "SETUP_BIOMETRICS" | "SETUP_PASSCODE";
"setOnboardingDone": "ONBOARDING_DONE";
"setPasscode": "SETUP_PASSCODE";
"setPasscodeSalt": "done.invoke.auth.introSlider:invocation[0]";
"setTourGuide": "SET_TOUR_GUIDE";
"storeContext": "INITIAL_DOWNLOAD_DONE" | "ONBOARDING_DONE" | "SETUP_BIOMETRICS" | "SETUP_PASSCODE" | "STORE_RESPONSE" | "done.invoke.auth.authorized:invocation[0]" | "done.invoke.auth.introSlider:invocation[0]";
};
eventsCausingDelays: {

};
eventsCausingGuards: {
"hasBiometricSet": "";
"hasData": "STORE_RESPONSE";
"hasLanguageset": "";
"hasPasscodeSet": "";
};
eventsCausingServices: {
"downloadFaceSdkModel": "LOGIN" | "SETUP_BIOMETRICS" | "SETUP_PASSCODE";
"generatePasscodeSalt": "SELECT";
};
matchesStates: "authorized" | "checkingAuth" | "init" | "introSlider" | "languagesetup" | "savingDefaults" | "settingUp" | "unauthorized";
tags: never;
}

11 changes: 7 additions & 4 deletions machines/settings.typegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,24 @@ export interface Typegen0 {
resetInjiProps: 'done.invoke.settings.resetInjiProps:invocation[0]';
};
missingImplementations: {
actions: never;
actions: 'setKeyManagementExplored';
delays: never;
guards: never;
services: never;
};
eventsCausingActions: {
requestStoredContext: 'xstate.init';
requestStoredContext: 'BIOMETRIC_CANCELLED' | 'xstate.init';
resetCredentialRegistryResponse: 'CANCEL' | 'UPDATE_HOST';
resetIsBiometricToggled: 'DISMISS';
setBackupAndRestoreOptionExplored: 'SET_IS_BACKUP_AND_RESTORE_EXPLORED';
resetKeyOrderingResponse: 'RESET_KEY_ORDER_RESPONSE';
setContext: 'STORE_RESPONSE';
setIsBiometricToggled: 'TOGGLE_BIOMETRIC_UNLOCK';
setKeyManagementExplored: 'SET_KEY_MANAGEMENT_EXPLORED';
setKeyManagementTourGuideExplored: 'SET_KEY_MANAGEMENT_TOUR_GUIDE_EXPLORED';
setKeyOrderingResponse: 'SET_KEY_ORDER_RESPONSE';
storeContext:
| 'ACCEPT_HARDWARE_SUPPORT_NOT_EXISTS'
| 'SET_IS_BACKUP_AND_RESTORE_EXPLORED'
| 'SET_KEY_MANAGEMENT_EXPLORED'
| 'SHOWN_ACCOUNT_SELECTION_CONFIRMATION'
| 'STORE_RESPONSE'
| 'TOGGLE_BIOMETRIC_UNLOCK'
Expand Down
6 changes: 5 additions & 1 deletion screens/PasscodeScreenController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ import {
sendEndEvent,
} from '../shared/telemetry/TelemetryUtils';
import {TelemetryConstants} from '../shared/telemetry/TelemetryConstants';
import {SettingsEvents} from '../machines/settings';

export function usePasscodeScreen(props: PasscodeRouteProps) {
const {appService} = useContext(GlobalContext);
const authService = appService.children.get('auth');

const settingsService = appService.children.get('settings');
const isAuthorized = useSelector(authService, selectAuthorized);
const isPasscodeSet = () => !!passcode;
const [passcode, setPasscode] = useState('');
Expand Down Expand Up @@ -56,6 +57,9 @@ export function usePasscodeScreen(props: PasscodeRouteProps) {

SETUP_PASSCODE: () => {
authService.send(AuthEvents.SETUP_PASSCODE(passcode));
settingsService?.send(
SettingsEvents.TOGGLE_BIOMETRIC_UNLOCK(false, true),
);
},

storedSalt: useSelector(authService, selectPasscodeSalt),
Expand Down
1 change: 0 additions & 1 deletion screens/Settings/SettingScreenController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ export function useSettingsScreen(props: RootRouteProps & RequestRouteProps) {

CHANGE_UNLOCK_METHOD: (val: boolean) => {
authService.send(AuthEvents.CHANGE_METHOD(true));
settingsService.send(SettingsEvents.TOGGLE_BIOMETRIC_UNLOCK(val, true));
props.navigation.navigate('Passcode', {setup: true});
},

Expand Down
Loading