@oxyhq/services 5.15.8 → 5.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/core/OxyServices.js +0 -1
- package/lib/commonjs/core/OxyServices.js.map +1 -1
- package/lib/commonjs/core/mixins/OxyServices.auth.js +3 -6
- package/lib/commonjs/core/mixins/OxyServices.auth.js.map +1 -1
- package/lib/commonjs/core/mixins/OxyServices.devices.js +1 -1
- package/lib/commonjs/core/mixins/OxyServices.devices.js.map +1 -1
- package/lib/commonjs/core/mixins/index.js +11 -12
- package/lib/commonjs/core/mixins/index.js.map +1 -1
- package/lib/commonjs/crypto/signatureService.js +3 -2
- package/lib/commonjs/crypto/signatureService.js.map +1 -1
- package/lib/commonjs/i18n/locales/ar-SA.json +1 -9
- package/lib/commonjs/i18n/locales/ca-ES.json +1 -9
- package/lib/commonjs/i18n/locales/de-DE.json +1 -9
- package/lib/commonjs/i18n/locales/en-US.json +3 -21
- package/lib/commonjs/i18n/locales/es-ES.json +3 -21
- package/lib/commonjs/i18n/locales/fr-FR.json +1 -9
- package/lib/commonjs/i18n/locales/it-IT.json +1 -9
- package/lib/commonjs/i18n/locales/ja-JP.json +1 -9
- package/lib/commonjs/i18n/locales/ko-KR.json +1 -9
- package/lib/commonjs/i18n/locales/pt-PT.json +1 -9
- package/lib/commonjs/i18n/locales/zh-CN.json +1 -9
- package/lib/commonjs/ui/context/OxyContext.js +24 -4
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +217 -100
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +2 -319
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/OxyAuthScreen.js +178 -77
- package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +0 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +43 -29
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/stores/authStore.js +14 -1
- package/lib/commonjs/ui/stores/authStore.js.map +1 -1
- package/lib/module/core/OxyServices.js +0 -1
- package/lib/module/core/OxyServices.js.map +1 -1
- package/lib/module/core/mixins/OxyServices.auth.js +3 -6
- package/lib/module/core/mixins/OxyServices.auth.js.map +1 -1
- package/lib/module/core/mixins/OxyServices.devices.js +1 -1
- package/lib/module/core/mixins/OxyServices.devices.js.map +1 -1
- package/lib/module/core/mixins/index.js +1 -2
- package/lib/module/core/mixins/index.js.map +1 -1
- package/lib/module/crypto/signatureService.js +3 -2
- package/lib/module/crypto/signatureService.js.map +1 -1
- package/lib/module/i18n/locales/ar-SA.json +1 -9
- package/lib/module/i18n/locales/ca-ES.json +1 -9
- package/lib/module/i18n/locales/de-DE.json +1 -9
- package/lib/module/i18n/locales/en-US.json +3 -21
- package/lib/module/i18n/locales/es-ES.json +3 -21
- package/lib/module/i18n/locales/fr-FR.json +1 -9
- package/lib/module/i18n/locales/it-IT.json +1 -9
- package/lib/module/i18n/locales/ja-JP.json +1 -9
- package/lib/module/i18n/locales/ko-KR.json +1 -9
- package/lib/module/i18n/locales/pt-PT.json +1 -9
- package/lib/module/i18n/locales/zh-CN.json +1 -9
- package/lib/module/ui/context/OxyContext.js +24 -4
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +217 -100
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +2 -319
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/OxyAuthScreen.js +179 -78
- package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +0 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +44 -29
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/stores/authStore.js +14 -1
- package/lib/module/ui/stores/authStore.js.map +1 -1
- package/lib/typescript/core/OxyServices.d.ts +0 -1
- package/lib/typescript/core/OxyServices.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.auth.d.ts +3 -4
- package/lib/typescript/core/mixins/OxyServices.auth.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.devices.d.ts +1 -4
- package/lib/typescript/core/mixins/OxyServices.devices.d.ts.map +1 -1
- package/lib/typescript/core/mixins/index.d.ts +1 -64
- package/lib/typescript/core/mixins/index.d.ts.map +1 -1
- package/lib/typescript/crypto/signatureService.d.ts +2 -1
- package/lib/typescript/crypto/signatureService.d.ts.map +1 -1
- package/lib/typescript/models/interfaces.d.ts +1 -1
- package/lib/typescript/models/interfaces.d.ts.map +1 -1
- package/lib/typescript/types/bip39.d.ts +1 -0
- package/lib/typescript/types/buffer.d.ts +1 -0
- package/lib/typescript/types/color.d.ts +1 -0
- package/lib/typescript/types/elliptic.d.ts +1 -0
- package/lib/typescript/types/expo-crypto.d.ts +1 -0
- package/lib/typescript/types/expo-secure-store.d.ts +1 -0
- package/lib/typescript/ui/context/OxyContext.d.ts +11 -3
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts +13 -5
- package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/OxyAuthScreen.d.ts +1 -0
- package/lib/typescript/ui/screens/OxyAuthScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/stores/authStore.d.ts +4 -0
- package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
- package/package.json +6 -5
- package/src/core/OxyServices.ts +0 -1
- package/src/core/mixins/OxyServices.auth.ts +3 -8
- package/src/core/mixins/OxyServices.devices.ts +1 -4
- package/src/core/mixins/index.ts +2 -5
- package/src/crypto/index.ts +1 -0
- package/src/crypto/keyManager.ts +1 -0
- package/src/crypto/polyfill.ts +1 -0
- package/src/crypto/recoveryPhrase.ts +1 -0
- package/src/crypto/signatureService.ts +4 -5
- package/src/i18n/locales/ar-SA.json +1 -9
- package/src/i18n/locales/ca-ES.json +1 -9
- package/src/i18n/locales/de-DE.json +1 -9
- package/src/i18n/locales/en-US.json +3 -21
- package/src/i18n/locales/es-ES.json +3 -21
- package/src/i18n/locales/fr-FR.json +1 -9
- package/src/i18n/locales/it-IT.json +1 -9
- package/src/i18n/locales/ja-JP.json +1 -9
- package/src/i18n/locales/ko-KR.json +1 -9
- package/src/i18n/locales/pt-PT.json +1 -9
- package/src/i18n/locales/zh-CN.json +1 -9
- package/src/models/interfaces.ts +1 -1
- package/src/types/bip39.d.ts +1 -0
- package/src/types/buffer.d.ts +1 -0
- package/src/types/color.d.ts +1 -0
- package/src/types/elliptic.d.ts +1 -0
- package/src/types/expo-crypto.d.ts +1 -0
- package/src/types/expo-secure-store.d.ts +1 -0
- package/src/ui/context/OxyContext.tsx +35 -3
- package/src/ui/context/hooks/useAuthOperations.ts +212 -98
- package/src/ui/screens/AccountSettingsScreen.tsx +1 -201
- package/src/ui/screens/OxyAuthScreen.tsx +193 -69
- package/src/ui/screens/PrivacySettingsScreen.tsx +0 -2
- package/src/ui/screens/SessionManagementScreen.tsx +43 -26
- package/src/ui/stores/authStore.ts +31 -2
- package/lib/commonjs/core/mixins/OxyServices.totp.js +0 -53
- package/lib/commonjs/core/mixins/OxyServices.totp.js.map +0 -1
- package/lib/commonjs/ui/components/profile/TwoFactorSetupModal.js +0 -467
- package/lib/commonjs/ui/components/profile/TwoFactorSetupModal.js.map +0 -1
- package/lib/module/core/mixins/OxyServices.totp.js +0 -49
- package/lib/module/core/mixins/OxyServices.totp.js.map +0 -1
- package/lib/module/ui/components/profile/TwoFactorSetupModal.js +0 -460
- package/lib/module/ui/components/profile/TwoFactorSetupModal.js.map +0 -1
- package/lib/typescript/core/mixins/OxyServices.totp.d.ts +0 -66
- package/lib/typescript/core/mixins/OxyServices.totp.d.ts.map +0 -1
- package/lib/typescript/ui/components/profile/TwoFactorSetupModal.d.ts +0 -11
- package/lib/typescript/ui/components/profile/TwoFactorSetupModal.d.ts.map +0 -1
- package/src/core/mixins/OxyServices.totp.ts +0 -36
- package/src/ui/components/profile/TwoFactorSetupModal.tsx +0 -442
|
@@ -25,10 +25,8 @@ var _EditEmailModal = require("../components/profile/EditEmailModal");
|
|
|
25
25
|
var _EditBioModal = require("../components/profile/EditBioModal");
|
|
26
26
|
var _EditLocationModal = require("../components/profile/EditLocationModal");
|
|
27
27
|
var _EditLinksModal = require("../components/profile/EditLinksModal");
|
|
28
|
-
var _TwoFactorSetupModal = require("../components/profile/TwoFactorSetupModal");
|
|
29
28
|
var _userUtils = require("../utils/user-utils");
|
|
30
29
|
var _cache = require("../../utils/cache");
|
|
31
|
-
var _reactNativeQrcodeSvg = _interopRequireDefault(require("react-native-qrcode-svg"));
|
|
32
30
|
var _OxyContext = require("../context/OxyContext");
|
|
33
31
|
var _spacing = require("../constants/spacing");
|
|
34
32
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -87,14 +85,6 @@ const AccountSettingsScreen = ({
|
|
|
87
85
|
const [quickActionsSectionY, setQuickActionsSectionY] = (0, _react.useState)(null);
|
|
88
86
|
const [securitySectionY, setSecuritySectionY] = (0, _react.useState)(null);
|
|
89
87
|
|
|
90
|
-
// Two-Factor (TOTP) state
|
|
91
|
-
const [totpSetupUrl, setTotpSetupUrl] = (0, _react.useState)(null);
|
|
92
|
-
const [totpCode, setTotpCode] = (0, _react.useState)('');
|
|
93
|
-
const [isTotpBusy, setIsTotpBusy] = (0, _react.useState)(false);
|
|
94
|
-
const [showRecoveryModal, setShowRecoveryModal] = (0, _react.useState)(false);
|
|
95
|
-
const [generatedBackupCodes, setGeneratedBackupCodes] = (0, _react.useState)(null);
|
|
96
|
-
const [generatedRecoveryKey, setGeneratedRecoveryKey] = (0, _react.useState)(null);
|
|
97
|
-
|
|
98
88
|
// Animation refs
|
|
99
89
|
const saveButtonScale = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
|
|
100
90
|
|
|
@@ -115,7 +105,6 @@ const AccountSettingsScreen = ({
|
|
|
115
105
|
const [showEditBioModal, setShowEditBioModal] = (0, _react.useState)(false);
|
|
116
106
|
const [showEditLocationModal, setShowEditLocationModal] = (0, _react.useState)(false);
|
|
117
107
|
const [showEditLinksModal, setShowEditLinksModal] = (0, _react.useState)(false);
|
|
118
|
-
const [showTwoFactorModal, setShowTwoFactorModal] = (0, _react.useState)(false);
|
|
119
108
|
|
|
120
109
|
// Location and links state (for display only - modals handle editing)
|
|
121
110
|
const [locations, setLocations] = (0, _react.useState)([]);
|
|
@@ -300,9 +289,6 @@ const AccountSettingsScreen = ({
|
|
|
300
289
|
case 'links':
|
|
301
290
|
setTempLinksWithMetadata([...linksMetadata]);
|
|
302
291
|
break;
|
|
303
|
-
case 'twoFactor':
|
|
304
|
-
// No temp state needed for twoFactor
|
|
305
|
-
break;
|
|
306
292
|
}
|
|
307
293
|
}, [displayName, lastName, username, email, bio, locations, linksMetadata]);
|
|
308
294
|
const cancelEditing = (0, _react.useCallback)(() => {
|
|
@@ -393,8 +379,6 @@ const AccountSettingsScreen = ({
|
|
|
393
379
|
return bio;
|
|
394
380
|
case 'location':
|
|
395
381
|
case 'links':
|
|
396
|
-
case 'twoFactor':
|
|
397
|
-
return '';
|
|
398
382
|
default:
|
|
399
383
|
return '';
|
|
400
384
|
}
|
|
@@ -495,7 +479,6 @@ const AccountSettingsScreen = ({
|
|
|
495
479
|
const handleOpenBioModal = (0, _react.useCallback)(() => setShowEditBioModal(true), []);
|
|
496
480
|
const handleOpenLocationModal = (0, _react.useCallback)(() => setShowEditLocationModal(true), []);
|
|
497
481
|
const handleOpenLinksModal = (0, _react.useCallback)(() => setShowEditLinksModal(true), []);
|
|
498
|
-
const handleOpenTwoFactorModal = (0, _react.useCallback)(() => setShowTwoFactorModal(true), []);
|
|
499
482
|
|
|
500
483
|
// Handler to refresh data after modal saves
|
|
501
484
|
// Note: Access user directly from store when invoked to get latest value,
|
|
@@ -574,9 +557,6 @@ const AccountSettingsScreen = ({
|
|
|
574
557
|
case 'links':
|
|
575
558
|
setShowEditLinksModal(true);
|
|
576
559
|
break;
|
|
577
|
-
case 'twoFactor':
|
|
578
|
-
setShowTwoFactorModal(true);
|
|
579
|
-
break;
|
|
580
560
|
}
|
|
581
561
|
}, 300);
|
|
582
562
|
}
|
|
@@ -698,186 +678,9 @@ const AccountSettingsScreen = ({
|
|
|
698
678
|
// Memoize display name for avatar
|
|
699
679
|
const displayNameForAvatar = (0, _react.useMemo)(() => (0, _userUtils.getDisplayName)(user), [user]);
|
|
700
680
|
|
|
701
|
-
// Legacy renderEditingField function (
|
|
681
|
+
// Legacy renderEditingField function (fallback)
|
|
702
682
|
const renderEditingField = type => {
|
|
703
683
|
if (!type) return null;
|
|
704
|
-
if (type === 'twoFactor') {
|
|
705
|
-
const enabled = !!user?.privacySettings?.twoFactorEnabled;
|
|
706
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
707
|
-
style: [styles.editingFieldContainer, {
|
|
708
|
-
backgroundColor: colors.background
|
|
709
|
-
}],
|
|
710
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
711
|
-
style: styles.editingFieldContent,
|
|
712
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
713
|
-
style: styles.newValueSection,
|
|
714
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
715
|
-
style: styles.editingFieldHeader,
|
|
716
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
717
|
-
style: [styles.editingFieldLabel, {
|
|
718
|
-
color: colors.text
|
|
719
|
-
}],
|
|
720
|
-
children: "Two\u2011Factor Authentication (TOTP)"
|
|
721
|
-
})
|
|
722
|
-
}), !enabled ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
723
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
724
|
-
style: styles.editingFieldDescription,
|
|
725
|
-
children: "Protect your account with a 6\u2011digit code from an authenticator app. Scan the QR code then enter the code to enable."
|
|
726
|
-
}), !totpSetupUrl ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
727
|
-
style: [styles.primaryButton, {
|
|
728
|
-
backgroundColor: colors.iconSecurity
|
|
729
|
-
}],
|
|
730
|
-
disabled: isTotpBusy,
|
|
731
|
-
onPress: async () => {
|
|
732
|
-
if (!activeSessionId) {
|
|
733
|
-
_sonner.toast.error(t('editProfile.toasts.noActiveSession') || 'No active session');
|
|
734
|
-
return;
|
|
735
|
-
}
|
|
736
|
-
setIsTotpBusy(true);
|
|
737
|
-
try {
|
|
738
|
-
const {
|
|
739
|
-
otpauthUrl
|
|
740
|
-
} = await oxyServices.startTotpEnrollment(activeSessionId);
|
|
741
|
-
setTotpSetupUrl(otpauthUrl);
|
|
742
|
-
} catch (e) {
|
|
743
|
-
_sonner.toast.error(e?.message || t('editProfile.toasts.totpStartFailed') || 'Failed to start TOTP enrollment');
|
|
744
|
-
} finally {
|
|
745
|
-
setIsTotpBusy(false);
|
|
746
|
-
}
|
|
747
|
-
},
|
|
748
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
|
|
749
|
-
name: "shield-checkmark",
|
|
750
|
-
size: 18,
|
|
751
|
-
color: "#fff"
|
|
752
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
753
|
-
style: styles.primaryButtonText,
|
|
754
|
-
children: "Generate QR Code"
|
|
755
|
-
})]
|
|
756
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
757
|
-
style: {
|
|
758
|
-
alignItems: 'center',
|
|
759
|
-
gap: 16
|
|
760
|
-
},
|
|
761
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
762
|
-
style: {
|
|
763
|
-
padding: 16,
|
|
764
|
-
backgroundColor: '#fff',
|
|
765
|
-
borderRadius: 16
|
|
766
|
-
},
|
|
767
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeQrcodeSvg.default, {
|
|
768
|
-
value: totpSetupUrl,
|
|
769
|
-
size: 180
|
|
770
|
-
})
|
|
771
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
772
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
773
|
-
style: styles.editingFieldLabel,
|
|
774
|
-
children: "Enter 6\u2011digit code"
|
|
775
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
776
|
-
style: styles.editingFieldInput,
|
|
777
|
-
keyboardType: "number-pad",
|
|
778
|
-
placeholder: "123456",
|
|
779
|
-
value: totpCode,
|
|
780
|
-
onChangeText: setTotpCode,
|
|
781
|
-
maxLength: 6
|
|
782
|
-
})]
|
|
783
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
784
|
-
style: [styles.primaryButton, {
|
|
785
|
-
backgroundColor: colors.iconSecurity
|
|
786
|
-
}],
|
|
787
|
-
disabled: isTotpBusy || totpCode.length !== 6,
|
|
788
|
-
onPress: async () => {
|
|
789
|
-
if (!activeSessionId) {
|
|
790
|
-
_sonner.toast.error(t('editProfile.toasts.noActiveSession') || 'No active session');
|
|
791
|
-
return;
|
|
792
|
-
}
|
|
793
|
-
setIsTotpBusy(true);
|
|
794
|
-
try {
|
|
795
|
-
const result = await oxyServices.verifyTotpEnrollment(activeSessionId, totpCode);
|
|
796
|
-
await updateUser({
|
|
797
|
-
privacySettings: {
|
|
798
|
-
twoFactorEnabled: true
|
|
799
|
-
}
|
|
800
|
-
}, oxyServices);
|
|
801
|
-
if (result?.backupCodes || result?.recoveryKey) {
|
|
802
|
-
setGeneratedBackupCodes(result.backupCodes || null);
|
|
803
|
-
setGeneratedRecoveryKey(result.recoveryKey || null);
|
|
804
|
-
setShowRecoveryModal(true);
|
|
805
|
-
} else {
|
|
806
|
-
_sonner.toast.success(t('editProfile.toasts.twoFactorEnabled') || 'Two‑Factor Authentication enabled');
|
|
807
|
-
setEditingField(null);
|
|
808
|
-
}
|
|
809
|
-
} catch (e) {
|
|
810
|
-
_sonner.toast.error(e?.message || t('editProfile.toasts.invalidCode') || 'Invalid code');
|
|
811
|
-
} finally {
|
|
812
|
-
setIsTotpBusy(false);
|
|
813
|
-
}
|
|
814
|
-
},
|
|
815
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
|
|
816
|
-
name: "checkmark-circle",
|
|
817
|
-
size: 18,
|
|
818
|
-
color: "#fff"
|
|
819
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
820
|
-
style: styles.primaryButtonText,
|
|
821
|
-
children: "Verify & Enable"
|
|
822
|
-
})]
|
|
823
|
-
})]
|
|
824
|
-
})]
|
|
825
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
826
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
827
|
-
style: styles.editingFieldDescription,
|
|
828
|
-
children: "Two\u2011Factor Authentication is currently enabled. To disable, enter a code from your authenticator app."
|
|
829
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
830
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
831
|
-
style: styles.editingFieldLabel,
|
|
832
|
-
children: "Enter 6\u2011digit code"
|
|
833
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
834
|
-
style: styles.editingFieldInput,
|
|
835
|
-
keyboardType: "number-pad",
|
|
836
|
-
placeholder: "123456",
|
|
837
|
-
value: totpCode,
|
|
838
|
-
onChangeText: setTotpCode,
|
|
839
|
-
maxLength: 6
|
|
840
|
-
})]
|
|
841
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
842
|
-
style: [styles.primaryButton, {
|
|
843
|
-
backgroundColor: colors.sidebarIconSharing
|
|
844
|
-
}],
|
|
845
|
-
disabled: isTotpBusy || totpCode.length !== 6,
|
|
846
|
-
onPress: async () => {
|
|
847
|
-
if (!activeSessionId) {
|
|
848
|
-
_sonner.toast.error(t('editProfile.toasts.noActiveSession') || 'No active session');
|
|
849
|
-
return;
|
|
850
|
-
}
|
|
851
|
-
setIsTotpBusy(true);
|
|
852
|
-
try {
|
|
853
|
-
await oxyServices.disableTotp(activeSessionId, totpCode);
|
|
854
|
-
await updateUser({
|
|
855
|
-
privacySettings: {
|
|
856
|
-
twoFactorEnabled: false
|
|
857
|
-
}
|
|
858
|
-
}, oxyServices);
|
|
859
|
-
_sonner.toast.success(t('editProfile.toasts.twoFactorDisabled') || 'Two‑Factor Authentication disabled');
|
|
860
|
-
setEditingField(null);
|
|
861
|
-
} catch (e) {
|
|
862
|
-
_sonner.toast.error(e?.message || t('editProfile.toasts.disableFailed') || 'Failed to disable');
|
|
863
|
-
} finally {
|
|
864
|
-
setIsTotpBusy(false);
|
|
865
|
-
}
|
|
866
|
-
},
|
|
867
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
|
|
868
|
-
name: "close-circle",
|
|
869
|
-
size: 18,
|
|
870
|
-
color: "#fff"
|
|
871
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
872
|
-
style: styles.primaryButtonText,
|
|
873
|
-
children: "Disable 2FA"
|
|
874
|
-
})]
|
|
875
|
-
})]
|
|
876
|
-
})]
|
|
877
|
-
})
|
|
878
|
-
})
|
|
879
|
-
});
|
|
880
|
-
}
|
|
881
684
|
if (type === 'displayName') {
|
|
882
685
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
883
686
|
style: [styles.editingFieldContainer, {
|
|
@@ -1473,111 +1276,6 @@ const AccountSettingsScreen = ({
|
|
|
1473
1276
|
}],
|
|
1474
1277
|
children: t('accountOverview.items.editProfile.subtitle') || t('editProfile.subtitle') || 'Manage your profile and preferences'
|
|
1475
1278
|
})]
|
|
1476
|
-
}), showRecoveryModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
1477
|
-
style: {
|
|
1478
|
-
position: 'absolute',
|
|
1479
|
-
top: 0,
|
|
1480
|
-
left: 0,
|
|
1481
|
-
right: 0,
|
|
1482
|
-
bottom: 0,
|
|
1483
|
-
backgroundColor: 'rgba(0,0,0,0.6)',
|
|
1484
|
-
zIndex: 50,
|
|
1485
|
-
padding: 16,
|
|
1486
|
-
justifyContent: 'center'
|
|
1487
|
-
},
|
|
1488
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
1489
|
-
style: {
|
|
1490
|
-
backgroundColor: '#fff',
|
|
1491
|
-
borderRadius: 20,
|
|
1492
|
-
padding: 20,
|
|
1493
|
-
maxHeight: '80%'
|
|
1494
|
-
},
|
|
1495
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
1496
|
-
style: {
|
|
1497
|
-
fontSize: 18,
|
|
1498
|
-
fontWeight: '700',
|
|
1499
|
-
marginBottom: 12
|
|
1500
|
-
},
|
|
1501
|
-
children: "Save These Codes Now"
|
|
1502
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
1503
|
-
style: {
|
|
1504
|
-
fontSize: 14,
|
|
1505
|
-
color: '#444',
|
|
1506
|
-
marginBottom: 12
|
|
1507
|
-
},
|
|
1508
|
-
children: "Backup codes and your Recovery Key are shown only once. Store them securely (paper or password manager)."
|
|
1509
|
-
}), generatedBackupCodes && generatedBackupCodes.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
1510
|
-
style: {
|
|
1511
|
-
marginBottom: 12
|
|
1512
|
-
},
|
|
1513
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
1514
|
-
style: {
|
|
1515
|
-
fontSize: 16,
|
|
1516
|
-
fontWeight: '600',
|
|
1517
|
-
marginBottom: 8
|
|
1518
|
-
},
|
|
1519
|
-
children: "Backup Codes"
|
|
1520
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
1521
|
-
style: {
|
|
1522
|
-
backgroundColor: '#F8F9FA',
|
|
1523
|
-
borderRadius: 12,
|
|
1524
|
-
padding: 12
|
|
1525
|
-
},
|
|
1526
|
-
children: generatedBackupCodes.map((c, idx) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
1527
|
-
style: {
|
|
1528
|
-
fontFamily: _reactNative.Platform.OS === 'web' ? 'monospace' : 'monospace',
|
|
1529
|
-
fontSize: 14,
|
|
1530
|
-
marginBottom: 4
|
|
1531
|
-
},
|
|
1532
|
-
children: c
|
|
1533
|
-
}, idx))
|
|
1534
|
-
})]
|
|
1535
|
-
}), generatedRecoveryKey && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
1536
|
-
style: {
|
|
1537
|
-
marginBottom: 12
|
|
1538
|
-
},
|
|
1539
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
1540
|
-
style: {
|
|
1541
|
-
fontSize: 16,
|
|
1542
|
-
fontWeight: '600',
|
|
1543
|
-
marginBottom: 8
|
|
1544
|
-
},
|
|
1545
|
-
children: "Recovery Key"
|
|
1546
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
1547
|
-
style: {
|
|
1548
|
-
backgroundColor: '#F8F9FA',
|
|
1549
|
-
borderRadius: 12,
|
|
1550
|
-
padding: 12
|
|
1551
|
-
},
|
|
1552
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
1553
|
-
style: {
|
|
1554
|
-
fontFamily: _reactNative.Platform.OS === 'web' ? 'monospace' : 'monospace',
|
|
1555
|
-
fontSize: 14
|
|
1556
|
-
},
|
|
1557
|
-
children: generatedRecoveryKey
|
|
1558
|
-
})
|
|
1559
|
-
})]
|
|
1560
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
1561
|
-
style: [styles.primaryButton, {
|
|
1562
|
-
backgroundColor: colors.iconSecurity,
|
|
1563
|
-
alignSelf: 'flex-end',
|
|
1564
|
-
marginTop: 8
|
|
1565
|
-
}],
|
|
1566
|
-
onPress: () => {
|
|
1567
|
-
setShowRecoveryModal(false);
|
|
1568
|
-
setEditingField(null);
|
|
1569
|
-
_sonner.toast.success(t('editProfile.toasts.twoFactorEnabled') || 'Two‑Factor Authentication enabled');
|
|
1570
|
-
},
|
|
1571
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
|
|
1572
|
-
name: "checkmark",
|
|
1573
|
-
size: 18,
|
|
1574
|
-
color: "#fff"
|
|
1575
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
1576
|
-
style: styles.primaryButtonText,
|
|
1577
|
-
children: "I saved them"
|
|
1578
|
-
})]
|
|
1579
|
-
})]
|
|
1580
|
-
})
|
|
1581
1279
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
1582
1280
|
ref: ref => {
|
|
1583
1281
|
avatarSectionRef.current = ref;
|
|
@@ -1808,17 +1506,7 @@ const AccountSettingsScreen = ({
|
|
|
1808
1506
|
}],
|
|
1809
1507
|
children: t('editProfile.sections.security') || 'SECURITY'
|
|
1810
1508
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
1811
|
-
style: styles.groupedSectionWrapper
|
|
1812
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.GroupedSection, {
|
|
1813
|
-
items: [{
|
|
1814
|
-
id: 'two-factor',
|
|
1815
|
-
icon: 'shield-lock',
|
|
1816
|
-
iconColor: colors.sidebarIconSecurity,
|
|
1817
|
-
title: t('editProfile.items.twoFactor.title') || 'Two‑Factor Authentication',
|
|
1818
|
-
subtitle: user?.privacySettings?.twoFactorEnabled ? t('editProfile.items.twoFactor.enabled') || 'Enabled' : t('editProfile.items.twoFactor.disabled') || 'Disabled (recommended)',
|
|
1819
|
-
onPress: handleOpenTwoFactorModal
|
|
1820
|
-
}]
|
|
1821
|
-
})
|
|
1509
|
+
style: styles.groupedSectionWrapper
|
|
1822
1510
|
})]
|
|
1823
1511
|
})]
|
|
1824
1512
|
})
|
|
@@ -1859,11 +1547,6 @@ const AccountSettingsScreen = ({
|
|
|
1859
1547
|
initialLinks: linksMetadata,
|
|
1860
1548
|
theme: normalizedTheme,
|
|
1861
1549
|
onSave: handleModalSave
|
|
1862
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TwoFactorSetupModal.TwoFactorSetupModal, {
|
|
1863
|
-
visible: showTwoFactorModal,
|
|
1864
|
-
onClose: () => setShowTwoFactorModal(false),
|
|
1865
|
-
isEnabled: !!user?.privacySettings?.twoFactorEnabled,
|
|
1866
|
-
theme: normalizedTheme
|
|
1867
1550
|
})]
|
|
1868
1551
|
});
|
|
1869
1552
|
};
|