diff --git a/app/containers/TwoFactor/index.test.tsx b/app/containers/TwoFactor/index.test.tsx index ae5700d4f69..21826e6a0b9 100644 --- a/app/containers/TwoFactor/index.test.tsx +++ b/app/containers/TwoFactor/index.test.tsx @@ -1,7 +1,8 @@ import { act, fireEvent, render, waitFor } from '@testing-library/react-native'; import TwoFactor from '.'; -import { isTwoFactorCancelled, twoFactor } from '../../lib/services/twoFactor'; +import { twoFactor } from '../../lib/services/twoFactor/twoFactor'; +import { isTwoFactorCancelled } from '../../lib/services/twoFactor/twoFactorCancelled'; jest.mock('../../lib/services/restApi', () => ({ sendEmailCode: jest.fn() diff --git a/app/containers/TwoFactor/index.tsx b/app/containers/TwoFactor/index.tsx index fe158025920..21b80e26cfd 100644 --- a/app/containers/TwoFactor/index.tsx +++ b/app/containers/TwoFactor/index.tsx @@ -22,8 +22,7 @@ import { useMasterDetail } from '../../lib/hooks/useMasterDetail'; import Toast from '../Toast'; import { showToast } from '../../lib/methods/helpers/showToast'; import log from '../../lib/methods/helpers/log'; - -export const TWO_FACTOR = 'TWO_FACTOR'; +import { TWO_FACTOR } from '../../lib/constants/twoFactor'; interface IMethodsProp { text: string; diff --git a/app/lib/constants/twoFactor.ts b/app/lib/constants/twoFactor.ts new file mode 100644 index 00000000000..8254f635e40 --- /dev/null +++ b/app/lib/constants/twoFactor.ts @@ -0,0 +1 @@ +export const TWO_FACTOR = 'TWO_FACTOR'; diff --git a/app/lib/methods/helpers/handleSaveUserProfileError.ts b/app/lib/methods/helpers/handleSaveUserProfileError.ts index ec2c3890329..cc80e73502e 100644 --- a/app/lib/methods/helpers/handleSaveUserProfileError.ts +++ b/app/lib/methods/helpers/handleSaveUserProfileError.ts @@ -1,6 +1,6 @@ import I18n from '../../../i18n'; import { showErrorAlert } from '.'; -import { isTwoFactorCancelled } from '../../services/twoFactorCancelled'; +import { isTwoFactorCancelled } from '../../services/twoFactor/twoFactorCancelled'; const handleSaveUserProfileError = (e: any, action: string) => { if (isTwoFactorCancelled(e)) { diff --git a/app/lib/methods/helpers/info.ts b/app/lib/methods/helpers/info.ts index 29977c0ffe7..12f7fc9ecec 100644 --- a/app/lib/methods/helpers/info.ts +++ b/app/lib/methods/helpers/info.ts @@ -1,7 +1,7 @@ import { Alert } from 'react-native'; import I18n from '../../../i18n'; -import { isTwoFactorCancelled } from '../../services/twoFactorCancelled'; +import { isTwoFactorCancelled } from '../../services/twoFactor/twoFactorCancelled'; export const showErrorAlert = (message: string, title?: string, onPress = () => {}): void => Alert.alert(title || '', message, [{ text: 'OK', onPress }], { cancelable: true }); diff --git a/app/lib/methods/helpers/log/index.ts b/app/lib/methods/helpers/log/index.ts index 7c4fcf17253..aa7ce730597 100644 --- a/app/lib/methods/helpers/log/index.ts +++ b/app/lib/methods/helpers/log/index.ts @@ -3,7 +3,7 @@ import { getCrashlytics as crashlytics } from '@react-native-firebase/crashlytic import bugsnag from '@bugsnag/react-native'; import events from './events'; -import { isTwoFactorCancelled } from '../../../services/twoFactorCancelled'; +import { isTwoFactorCancelled } from '../../../services/twoFactor/twoFactorCancelled'; export { events }; diff --git a/app/lib/methods/subscriptions/__tests__/roomSubscription.integration.test.ts b/app/lib/methods/subscriptions/__tests__/roomSubscription.integration.test.ts index 678565f5ef0..2cd653af94e 100644 --- a/app/lib/methods/subscriptions/__tests__/roomSubscription.integration.test.ts +++ b/app/lib/methods/subscriptions/__tests__/roomSubscription.integration.test.ts @@ -21,7 +21,7 @@ jest.mock('../../helpers/log', () => ({ default: jest.fn() })); -jest.mock('../../../services/twoFactor', () => ({ +jest.mock('../../../services/twoFactor/twoFactor', () => ({ twoFactor: jest.fn() })); diff --git a/app/lib/services/__tests__/connect.integration.test.ts b/app/lib/services/__tests__/connect.integration.test.ts index ade8f5717c5..bdb75990c60 100644 --- a/app/lib/services/__tests__/connect.integration.test.ts +++ b/app/lib/services/__tests__/connect.integration.test.ts @@ -29,7 +29,7 @@ jest.mock('../voip/MediaSessionInstance', () => ({ } })); -jest.mock('../twoFactor', () => ({ +jest.mock('../twoFactor/twoFactor', () => ({ twoFactor: jest.fn() })); diff --git a/app/lib/services/connect.ts b/app/lib/services/connect.ts index c56edc7a6e6..0f6abd2fc62 100644 --- a/app/lib/services/connect.ts +++ b/app/lib/services/connect.ts @@ -7,7 +7,7 @@ import log from '../methods/helpers/log'; import { setActiveUsers } from '../../actions/activeUsers'; import protectedFunction from '../methods/helpers/protectedFunction'; import database from '../database'; -import { twoFactor } from './twoFactor'; +import { twoFactor } from './twoFactor/twoFactor'; import { store } from '../store/auxStore'; import { loginRequest, logout, setLoginServices, setUser } from '../../actions/login'; import { waitForLoginReady } from './waitForLoginReady'; diff --git a/app/lib/services/sdk.test.ts b/app/lib/services/sdk.test.ts index aeba40547e9..66f806efb1b 100644 --- a/app/lib/services/sdk.test.ts +++ b/app/lib/services/sdk.test.ts @@ -1,5 +1,5 @@ import sdk from './sdk'; -import { TwoFactorCancelledError, isTwoFactorCancelled } from './twoFactor'; +import { TwoFactorCancelledError, isTwoFactorCancelled } from './twoFactor/twoFactorCancelled'; const mockInnerMethodCall = jest.fn(); const mockInnerPost = jest.fn(); @@ -13,10 +13,9 @@ jest.mock('@rocket.chat/sdk', () => ({ settings: { customHeaders: {} } })); -jest.mock('../../containers/TwoFactor', () => ({ TWO_FACTOR: 'TWO_FACTOR' })); +jest.mock('../constants/twoFactor', () => ({ TWO_FACTOR: 'TWO_FACTOR' })); -jest.mock('./twoFactor', () => ({ - ...jest.requireActual('./twoFactor'), +jest.mock('./twoFactor/twoFactor', () => ({ twoFactor: (...args: unknown[]) => mockTwoFactor(...args) })); diff --git a/app/lib/services/sdk.ts b/app/lib/services/sdk.ts index 3da561e9dcf..24de097522c 100644 --- a/app/lib/services/sdk.ts +++ b/app/lib/services/sdk.ts @@ -3,7 +3,7 @@ import { type ICallback, type ICurrentLogin, type ILoginCredentials, type ISubsc import EJSON from 'ejson'; import isEmpty from 'lodash/isEmpty'; -import { twoFactor } from './twoFactor'; +import { twoFactor } from './twoFactor/twoFactor'; import { isSsl } from '../methods/helpers/isSsl'; import { store as reduxStore } from '../store/auxStore'; import { diff --git a/app/lib/services/twoFactor.ts b/app/lib/services/twoFactor/twoFactor.ts similarity index 73% rename from app/lib/services/twoFactor.ts rename to app/lib/services/twoFactor/twoFactor.ts index 4d2c91dd1dd..d382f591d52 100644 --- a/app/lib/services/twoFactor.ts +++ b/app/lib/services/twoFactor/twoFactor.ts @@ -1,12 +1,10 @@ import { settings } from '@rocket.chat/sdk'; -import { TWO_FACTOR } from '../../containers/TwoFactor'; -import EventEmitter from '../methods/helpers/events'; -import { type ILoginCredentials } from '../../definitions'; +import { TWO_FACTOR } from '../../constants/twoFactor'; +import EventEmitter from '../../methods/helpers/events'; +import { type ILoginCredentials } from '../../../definitions'; import { TwoFactorCancelledError } from './twoFactorCancelled'; -export { TwoFactorCancelledError, isTwoFactorCancelled } from './twoFactorCancelled'; - interface ITwoFactor { method: string; invalid: boolean; diff --git a/app/lib/methods/helpers/twoFactorCancellation.test.ts b/app/lib/services/twoFactor/twoFactorCancellation.test.ts similarity index 87% rename from app/lib/methods/helpers/twoFactorCancellation.test.ts rename to app/lib/services/twoFactor/twoFactorCancellation.test.ts index d9b6e7fa667..0151025e9b1 100644 --- a/app/lib/methods/helpers/twoFactorCancellation.test.ts +++ b/app/lib/services/twoFactor/twoFactorCancellation.test.ts @@ -1,11 +1,11 @@ import { Alert } from 'react-native'; import bugsnag from '@bugsnag/react-native'; -import log from './log'; -import { showErrorAlertWithEMessage } from './info'; -import handleSaveUserProfileError from './handleSaveUserProfileError'; +import log from '../../methods/helpers/log'; +import { showErrorAlertWithEMessage } from '../../methods/helpers/info'; +import handleSaveUserProfileError from '../../methods/helpers/handleSaveUserProfileError'; import { handleLoginErrors } from '../../../views/LoginView/handleLoginErrors'; -import { TwoFactorCancelledError } from '../../services/twoFactorCancelled'; +import { TwoFactorCancelledError } from './twoFactorCancelled'; jest.mock('../../../i18n', () => ({ t: (key: string) => key, diff --git a/app/lib/services/twoFactorCancelled.ts b/app/lib/services/twoFactor/twoFactorCancelled.ts similarity index 100% rename from app/lib/services/twoFactorCancelled.ts rename to app/lib/services/twoFactor/twoFactorCancelled.ts diff --git a/app/sagas/__tests__/foregroundResume.integration.test.ts b/app/sagas/__tests__/foregroundResume.integration.test.ts index 0e2f054e049..307a06838de 100644 --- a/app/sagas/__tests__/foregroundResume.integration.test.ts +++ b/app/sagas/__tests__/foregroundResume.integration.test.ts @@ -43,7 +43,7 @@ jest.mock('../../lib/services/voip/MediaSessionStore', () => ({ mediaSessionStore: { getCurrentInstance: jest.fn(() => null) } })); -jest.mock('../../lib/services/twoFactor', () => ({ +jest.mock('../../lib/services/twoFactor/twoFactor', () => ({ twoFactor: jest.fn() })); diff --git a/app/sagas/__tests__/selectServer.sdkHost.test.ts b/app/sagas/__tests__/selectServer.sdkHost.test.ts index 6d58e4938ef..f45a410538e 100644 --- a/app/sagas/__tests__/selectServer.sdkHost.test.ts +++ b/app/sagas/__tests__/selectServer.sdkHost.test.ts @@ -28,7 +28,7 @@ jest.mock('../../lib/methods/helpers/log', () => ({ logServerVersion: jest.fn() })); -jest.mock('../../lib/services/twoFactor', () => ({ +jest.mock('../../lib/services/twoFactor/twoFactor', () => ({ twoFactor: jest.fn() })); diff --git a/app/sagas/login.js b/app/sagas/login.js index 4138d3960b9..3c7160cf633 100644 --- a/app/sagas/login.js +++ b/app/sagas/login.js @@ -29,7 +29,7 @@ import { getIsMasterDetail } from '../lib/hooks/useMasterDetail'; import { getEnterpriseModules, isOmnichannelModuleAvailable, isVoipModuleAvailable } from '../lib/methods/enterpriseModules'; import { getPermissions } from '../lib/methods/getPermissions'; import { getRoles } from '../lib/methods/getRoles'; -import { isTwoFactorCancelled } from '../lib/services/twoFactor'; +import { isTwoFactorCancelled } from '../lib/services/twoFactor/twoFactorCancelled'; import { getSlashCommands } from '../lib/methods/getSlashCommands'; import { getUserPresence, refreshDmUsersPresence, subscribeUsersPresence } from '../lib/methods/getUsersPresence'; import { logout, removeServerData, removeServerDatabase } from '../lib/methods/logout'; diff --git a/app/views/ChangeAvatarView/index.tsx b/app/views/ChangeAvatarView/index.tsx index c09251f891b..d3a9dc57bd6 100644 --- a/app/views/ChangeAvatarView/index.tsx +++ b/app/views/ChangeAvatarView/index.tsx @@ -29,7 +29,7 @@ import ImagePicker, { type Image } from '../../lib/methods/helpers/ImagePicker/I import { compareServerVersion, isImageURL, useDebounce } from '../../lib/methods/helpers'; import { ControlledFormTextInput } from '../../containers/TextInput'; import { HeaderBackButton } from '../../containers/Header/components/HeaderBackButton'; -import { isTwoFactorCancelled } from '../../lib/services/twoFactor'; +import { isTwoFactorCancelled } from '../../lib/services/twoFactor/twoFactorCancelled'; enum AvatarStateActions { CHANGE_AVATAR = 'CHANGE_AVATAR', diff --git a/app/views/ChangeAvatarView/submitHelpers.ts b/app/views/ChangeAvatarView/submitHelpers.ts index ae850649b6f..617afc5a7b1 100644 --- a/app/views/ChangeAvatarView/submitHelpers.ts +++ b/app/views/ChangeAvatarView/submitHelpers.ts @@ -1,5 +1,5 @@ import I18n from '../../i18n'; -import { isTwoFactorCancelled } from '../../lib/services/twoFactorCancelled'; +import { isTwoFactorCancelled } from '../../lib/services/twoFactor/twoFactorCancelled'; export const handleError = (e: any, action: string) => { if (isTwoFactorCancelled(e)) { diff --git a/app/views/ChangePasswordView/index.test.tsx b/app/views/ChangePasswordView/index.test.tsx index 4e7d2eccd77..f9dd9726fad 100644 --- a/app/views/ChangePasswordView/index.test.tsx +++ b/app/views/ChangePasswordView/index.test.tsx @@ -4,8 +4,8 @@ import { useDispatch } from 'react-redux'; import ChangePasswordView from './index'; import { useAppSelector } from '../../lib/hooks/useAppSelector'; import { saveUserProfile } from '../../lib/services/restApi'; -import { twoFactor } from '../../lib/services/twoFactor'; -import { TwoFactorCancelledError } from '../../lib/services/twoFactor'; +import { twoFactor } from '../../lib/services/twoFactor/twoFactor'; +import { TwoFactorCancelledError } from '../../lib/services/twoFactor/twoFactorCancelled'; import handleSaveUserProfileError from '../../lib/methods/helpers/handleSaveUserProfileError'; import { TwoFactorMethods } from '../../definitions/ITotp'; @@ -22,8 +22,7 @@ jest.mock('../../lib/services/restApi', () => ({ setPassword: jest.fn() })); -jest.mock('../../lib/services/twoFactor', () => ({ - ...jest.requireActual('../../lib/services/twoFactor'), +jest.mock('../../lib/services/twoFactor/twoFactor', () => ({ twoFactor: jest.fn() })); diff --git a/app/views/ChangePasswordView/index.tsx b/app/views/ChangePasswordView/index.tsx index 1e8fa7d15b9..4a679417fbc 100644 --- a/app/views/ChangePasswordView/index.tsx +++ b/app/views/ChangePasswordView/index.tsx @@ -7,7 +7,8 @@ import { type NativeStackNavigationProp } from '@react-navigation/native-stack'; import { useDispatch } from 'react-redux'; import { sha256 } from 'js-sha256'; -import { twoFactor, isTwoFactorCancelled } from '../../lib/services/twoFactor'; +import { twoFactor } from '../../lib/services/twoFactor/twoFactor'; +import { isTwoFactorCancelled } from '../../lib/services/twoFactor/twoFactorCancelled'; import { type ProfileStackParamList } from '../../stacks/types'; import { ControlledFormTextInput } from '../../containers/TextInput'; import { useAppSelector } from '../../lib/hooks/useAppSelector'; diff --git a/app/views/E2EEToggleRoomView/resetRoomKey.ts b/app/views/E2EEToggleRoomView/resetRoomKey.ts index e31308890f4..767260227b7 100644 --- a/app/views/E2EEToggleRoomView/resetRoomKey.ts +++ b/app/views/E2EEToggleRoomView/resetRoomKey.ts @@ -5,7 +5,7 @@ import { Encryption } from '../../lib/encryption'; import log from '../../lib/methods/helpers/log'; import { showToast } from '../../lib/methods/helpers/showToast'; import { e2eResetRoomKey } from '../../lib/services/restApi'; -import { isTwoFactorCancelled } from '../../lib/services/twoFactor'; +import { isTwoFactorCancelled } from '../../lib/services/twoFactor/twoFactorCancelled'; export const resetRoomKey = (rid: string) => { Alert.alert( diff --git a/app/views/E2EEncryptionSecurityView/ChangePassword.tsx b/app/views/E2EEncryptionSecurityView/ChangePassword.tsx index 3a705fca81f..27086b6c0b6 100644 --- a/app/views/E2EEncryptionSecurityView/ChangePassword.tsx +++ b/app/views/E2EEncryptionSecurityView/ChangePassword.tsx @@ -8,7 +8,7 @@ import log, { events, logEvent } from '../../lib/methods/helpers/log'; import { FormTextInput } from '../../containers/TextInput'; import Button from '../../containers/Button'; import { Encryption } from '../../lib/encryption'; -import { isTwoFactorCancelled } from '../../lib/services/twoFactor'; +import { isTwoFactorCancelled } from '../../lib/services/twoFactor/twoFactorCancelled'; import { showConfirmationAlert, showErrorAlert } from '../../lib/methods/helpers/info'; import EventEmitter from '../../lib/methods/helpers/events'; import { LISTENER } from '../../containers/Toast'; diff --git a/app/views/E2EEncryptionSecurityView/index.tsx b/app/views/E2EEncryptionSecurityView/index.tsx index 1cb4dcca8e8..5af6ade1dc8 100644 --- a/app/views/E2EEncryptionSecurityView/index.tsx +++ b/app/views/E2EEncryptionSecurityView/index.tsx @@ -13,7 +13,7 @@ import Button from '../../containers/Button'; import { logout } from '../../actions/login'; import { showConfirmationAlert, showErrorAlert } from '../../lib/methods/helpers/info'; import { e2eResetOwnKey } from '../../lib/services/restApi'; -import { isTwoFactorCancelled } from '../../lib/services/twoFactor'; +import { isTwoFactorCancelled } from '../../lib/services/twoFactor/twoFactorCancelled'; import { type SettingsStackParamList } from '../../stacks/types'; import ChangePassword from './ChangePassword'; import { styles } from './styles'; diff --git a/app/views/ProfileView/components/DeleteAccountActionSheetContent/ConfirmDeleteAccountContent.tsx b/app/views/ProfileView/components/DeleteAccountActionSheetContent/ConfirmDeleteAccountContent.tsx index 35855b77e30..817022d8efa 100644 --- a/app/views/ProfileView/components/DeleteAccountActionSheetContent/ConfirmDeleteAccountContent.tsx +++ b/app/views/ProfileView/components/DeleteAccountActionSheetContent/ConfirmDeleteAccountContent.tsx @@ -7,7 +7,7 @@ import sharedStyles from '../../../Styles'; import FooterButtons from './FooterButtons'; import AlertText from './AlertText'; import { deleteOwnAccount } from '../../../../lib/services/restApi'; -import { isTwoFactorCancelled } from '../../../../lib/services/twoFactor'; +import { isTwoFactorCancelled } from '../../../../lib/services/twoFactor/twoFactorCancelled'; import { deleteAccount } from '../../../../actions/login'; import { CustomIcon } from '../../../../containers/CustomIcon'; import { useTheme } from '../../../../theme'; diff --git a/app/views/ProfileView/components/DeleteAccountActionSheetContent/index.tsx b/app/views/ProfileView/components/DeleteAccountActionSheetContent/index.tsx index c36a427724b..cd0caeffbfe 100644 --- a/app/views/ProfileView/components/DeleteAccountActionSheetContent/index.tsx +++ b/app/views/ProfileView/components/DeleteAccountActionSheetContent/index.tsx @@ -9,7 +9,7 @@ import sharedStyles from '../../../Styles'; import FooterButtons from './FooterButtons'; import ConfirmDeleteAccountContent from './ConfirmDeleteAccountContent'; import { deleteOwnAccount } from '../../../../lib/services/restApi'; -import { isTwoFactorCancelled } from '../../../../lib/services/twoFactor'; +import { isTwoFactorCancelled } from '../../../../lib/services/twoFactor/twoFactorCancelled'; import { deleteAccount } from '../../../../actions/login'; import { CustomIcon } from '../../../../containers/CustomIcon'; import { useTheme } from '../../../../theme'; diff --git a/app/views/ProfileView/index.test.tsx b/app/views/ProfileView/index.test.tsx index b1b456993ca..088fa83cd2f 100644 --- a/app/views/ProfileView/index.test.tsx +++ b/app/views/ProfileView/index.test.tsx @@ -5,8 +5,8 @@ import { sha256 } from 'js-sha256'; import ProfileView from './index'; import { useAppSelector } from '../../lib/hooks/useAppSelector'; import { saveUserProfile } from '../../lib/services/restApi'; -import { twoFactor } from '../../lib/services/twoFactor'; -import { TwoFactorCancelledError } from '../../lib/services/twoFactorCancelled'; +import { twoFactor } from '../../lib/services/twoFactor/twoFactor'; +import { TwoFactorCancelledError } from '../../lib/services/twoFactor/twoFactorCancelled'; import handleSaveUserProfileError from '../../lib/methods/helpers/handleSaveUserProfileError'; import EventEmitter from '../../lib/methods/helpers/events'; import { setUser } from '../../actions/login'; @@ -28,8 +28,7 @@ jest.mock('../../lib/services/restApi', () => ({ saveUserProfile: jest.fn() })); -jest.mock('../../lib/services/twoFactor', () => ({ - ...jest.requireActual('../../lib/services/twoFactor'), +jest.mock('../../lib/services/twoFactor/twoFactor', () => ({ twoFactor: jest.fn() })); diff --git a/app/views/ProfileView/index.tsx b/app/views/ProfileView/index.tsx index 7dff44bbbd1..6429d52bba1 100644 --- a/app/views/ProfileView/index.tsx +++ b/app/views/ProfileView/index.tsx @@ -26,7 +26,8 @@ import EventEmitter from '../../lib/methods/helpers/events'; import { events, logEvent } from '../../lib/methods/helpers/log'; import scrollPersistTaps from '../../lib/methods/helpers/scrollPersistTaps'; import { saveUserProfile } from '../../lib/services/restApi'; -import { twoFactor, isTwoFactorCancelled } from '../../lib/services/twoFactor'; +import { twoFactor } from '../../lib/services/twoFactor/twoFactor'; +import { isTwoFactorCancelled } from '../../lib/services/twoFactor/twoFactorCancelled'; import { getUserSelector } from '../../selectors/login'; import { type ProfileStackParamList } from '../../stacks/types'; import { useTheme } from '../../theme'; diff --git a/app/views/ProfileView/methods/logoutOtherLocations.ts b/app/views/ProfileView/methods/logoutOtherLocations.ts index 17b713e999f..82f718caf3d 100644 --- a/app/views/ProfileView/methods/logoutOtherLocations.ts +++ b/app/views/ProfileView/methods/logoutOtherLocations.ts @@ -4,7 +4,7 @@ import EventEmitter from '../../../lib/methods/helpers/events'; import { showConfirmationAlert } from '../../../lib/methods/helpers'; import { events, logEvent } from '../../../lib/methods/helpers/log'; import { logoutOtherLocations as logoutOtherLocationsService } from '../../../lib/services/restApi'; -import { isTwoFactorCancelled } from '../../../lib/services/twoFactor'; +import { isTwoFactorCancelled } from '../../../lib/services/twoFactor/twoFactorCancelled'; const logoutOtherLocations = () => { logEvent(events.PL_OTHER_LOCATIONS); diff --git a/app/views/SetUsernameView.tsx b/app/views/SetUsernameView.tsx index 25cebd61fba..59efecbfb8c 100644 --- a/app/views/SetUsernameView.tsx +++ b/app/views/SetUsernameView.tsx @@ -20,7 +20,7 @@ import { showErrorAlert } from '../lib/methods/helpers'; import scrollPersistTaps from '../lib/methods/helpers/scrollPersistTaps'; import sharedStyles from './Styles'; import { getUsernameSuggestion, saveUserProfile } from '../lib/services/restApi'; -import { isTwoFactorCancelled } from '../lib/services/twoFactor'; +import { isTwoFactorCancelled } from '../lib/services/twoFactor/twoFactorCancelled'; import { useAppSelector } from '../lib/hooks/useAppSelector'; const styles = StyleSheet.create({