@oxyhq/services 5.15.9 → 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 +16 -7
- 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 +16 -7
- 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.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 +16 -8
- 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
|
@@ -1,460 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { useState, useEffect } from 'react';
|
|
4
|
-
import { View, Text, TextInput, TouchableOpacity, StyleSheet, Modal, Platform, ScrollView, ActivityIndicator } from 'react-native';
|
|
5
|
-
import { Ionicons } from '@expo/vector-icons';
|
|
6
|
-
import QRCode from 'react-native-qrcode-svg';
|
|
7
|
-
import { useThemeStyles } from '../../hooks/useThemeStyles';
|
|
8
|
-
import { useColorScheme } from '../../hooks/use-color-scheme';
|
|
9
|
-
import { useI18n } from '../../hooks/useI18n';
|
|
10
|
-
import { fontFamilies } from '../../styles/fonts';
|
|
11
|
-
import { useOxy } from '../../context/OxyContext';
|
|
12
|
-
import { useAuthStore } from '../../stores/authStore';
|
|
13
|
-
import { toast } from '../../../lib/sonner';
|
|
14
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
|
-
export const TwoFactorSetupModal = ({
|
|
16
|
-
visible,
|
|
17
|
-
onClose,
|
|
18
|
-
isEnabled,
|
|
19
|
-
theme = 'light',
|
|
20
|
-
onSave
|
|
21
|
-
}) => {
|
|
22
|
-
const {
|
|
23
|
-
t
|
|
24
|
-
} = useI18n();
|
|
25
|
-
const colorScheme = useColorScheme();
|
|
26
|
-
const themeStyles = useThemeStyles(theme || 'light', colorScheme);
|
|
27
|
-
const colors = themeStyles.colors;
|
|
28
|
-
const {
|
|
29
|
-
oxyServices,
|
|
30
|
-
activeSessionId
|
|
31
|
-
} = useOxy();
|
|
32
|
-
const updateUser = useAuthStore(state => state.updateUser);
|
|
33
|
-
const [totpSetupUrl, setTotpSetupUrl] = useState(null);
|
|
34
|
-
const [totpCode, setTotpCode] = useState('');
|
|
35
|
-
const [isBusy, setIsBusy] = useState(false);
|
|
36
|
-
const [showRecoveryCodes, setShowRecoveryCodes] = useState(false);
|
|
37
|
-
const [recoveryCodes, setRecoveryCodes] = useState(null);
|
|
38
|
-
const [recoveryKey, setRecoveryKey] = useState(null);
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
if (visible && !isEnabled) {
|
|
41
|
-
setTotpSetupUrl(null);
|
|
42
|
-
setTotpCode('');
|
|
43
|
-
setShowRecoveryCodes(false);
|
|
44
|
-
setRecoveryCodes(null);
|
|
45
|
-
setRecoveryKey(null);
|
|
46
|
-
}
|
|
47
|
-
}, [visible, isEnabled]);
|
|
48
|
-
const handleGenerateQR = async () => {
|
|
49
|
-
if (!activeSessionId || !oxyServices) {
|
|
50
|
-
toast.error(t('editProfile.toasts.noActiveSession') || 'No active session');
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
setIsBusy(true);
|
|
54
|
-
try {
|
|
55
|
-
const {
|
|
56
|
-
otpauthUrl
|
|
57
|
-
} = await oxyServices.startTotpEnrollment(activeSessionId);
|
|
58
|
-
setTotpSetupUrl(otpauthUrl);
|
|
59
|
-
} catch (e) {
|
|
60
|
-
toast.error(e?.message || t('editProfile.toasts.totpStartFailed') || 'Failed to start TOTP enrollment');
|
|
61
|
-
} finally {
|
|
62
|
-
setIsBusy(false);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
const handleVerify = async () => {
|
|
66
|
-
if (!activeSessionId || !oxyServices) {
|
|
67
|
-
toast.error(t('editProfile.toasts.noActiveSession') || 'No active session');
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (totpCode.length !== 6) {
|
|
71
|
-
toast.error(t('editProfile.toasts.invalidCode') || 'Please enter a 6-digit code');
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
setIsBusy(true);
|
|
75
|
-
try {
|
|
76
|
-
const result = await oxyServices.verifyTotpEnrollment(activeSessionId, totpCode);
|
|
77
|
-
await updateUser({
|
|
78
|
-
privacySettings: {
|
|
79
|
-
twoFactorEnabled: true
|
|
80
|
-
}
|
|
81
|
-
}, oxyServices);
|
|
82
|
-
if (result?.backupCodes || result?.recoveryKey) {
|
|
83
|
-
setRecoveryCodes(result.backupCodes || null);
|
|
84
|
-
setRecoveryKey(result.recoveryKey || null);
|
|
85
|
-
setShowRecoveryCodes(true);
|
|
86
|
-
} else {
|
|
87
|
-
toast.success(t('editProfile.toasts.twoFactorEnabled') || 'Two‑Factor Authentication enabled');
|
|
88
|
-
onSave?.();
|
|
89
|
-
onClose();
|
|
90
|
-
}
|
|
91
|
-
} catch (e) {
|
|
92
|
-
toast.error(e?.message || t('editProfile.toasts.invalidCode') || 'Invalid code');
|
|
93
|
-
} finally {
|
|
94
|
-
setIsBusy(false);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
const handleDisable = async () => {
|
|
98
|
-
if (!activeSessionId || !oxyServices) {
|
|
99
|
-
toast.error(t('editProfile.toasts.noActiveSession') || 'No active session');
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
if (totpCode.length !== 6) {
|
|
103
|
-
toast.error(t('editProfile.toasts.invalidCode') || 'Please enter a 6-digit code');
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
setIsBusy(true);
|
|
107
|
-
try {
|
|
108
|
-
// Verify code before disabling
|
|
109
|
-
await oxyServices.verifyTotpEnrollment(activeSessionId, totpCode);
|
|
110
|
-
await updateUser({
|
|
111
|
-
privacySettings: {
|
|
112
|
-
twoFactorEnabled: false
|
|
113
|
-
}
|
|
114
|
-
}, oxyServices);
|
|
115
|
-
toast.success(t('editProfile.toasts.twoFactorDisabled') || 'Two‑Factor Authentication disabled');
|
|
116
|
-
onSave?.();
|
|
117
|
-
onClose();
|
|
118
|
-
} catch (e) {
|
|
119
|
-
toast.error(e?.message || t('editProfile.toasts.invalidCode') || 'Invalid code');
|
|
120
|
-
} finally {
|
|
121
|
-
setIsBusy(false);
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
return /*#__PURE__*/_jsx(Modal, {
|
|
125
|
-
visible: visible,
|
|
126
|
-
animationType: "slide",
|
|
127
|
-
transparent: true,
|
|
128
|
-
onRequestClose: onClose,
|
|
129
|
-
children: /*#__PURE__*/_jsx(View, {
|
|
130
|
-
style: styles.modalOverlay,
|
|
131
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
132
|
-
style: [styles.modalContent, {
|
|
133
|
-
backgroundColor: colors.background
|
|
134
|
-
}],
|
|
135
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
136
|
-
style: styles.modalHeader,
|
|
137
|
-
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
138
|
-
onPress: onClose,
|
|
139
|
-
style: styles.closeButton,
|
|
140
|
-
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
141
|
-
name: "close",
|
|
142
|
-
size: 24,
|
|
143
|
-
color: colors.text
|
|
144
|
-
})
|
|
145
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
146
|
-
style: [styles.modalTitle, {
|
|
147
|
-
color: colors.text
|
|
148
|
-
}],
|
|
149
|
-
children: t('editProfile.items.twoFactor.title') || 'Two‑Factor Authentication'
|
|
150
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
151
|
-
style: {
|
|
152
|
-
width: 40
|
|
153
|
-
}
|
|
154
|
-
})]
|
|
155
|
-
}), /*#__PURE__*/_jsx(ScrollView, {
|
|
156
|
-
style: styles.modalBody,
|
|
157
|
-
children: showRecoveryCodes ? /*#__PURE__*/_jsxs(View, {
|
|
158
|
-
style: styles.recoverySection,
|
|
159
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
160
|
-
style: [styles.sectionTitle, {
|
|
161
|
-
color: colors.text
|
|
162
|
-
}],
|
|
163
|
-
children: t('editProfile.items.twoFactor.saveCodes') || 'Save These Codes'
|
|
164
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
165
|
-
style: [styles.description, {
|
|
166
|
-
color: colors.secondaryText
|
|
167
|
-
}],
|
|
168
|
-
children: t('editProfile.items.twoFactor.recoveryDescription') || 'Backup codes and your Recovery Key are shown only once. Store them securely.'
|
|
169
|
-
}), recoveryCodes && recoveryCodes.length > 0 && /*#__PURE__*/_jsxs(View, {
|
|
170
|
-
style: styles.recoveryCodesContainer,
|
|
171
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
172
|
-
style: [styles.recoveryLabel, {
|
|
173
|
-
color: colors.text
|
|
174
|
-
}],
|
|
175
|
-
children: "Backup Codes"
|
|
176
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
177
|
-
style: [styles.codesBox, {
|
|
178
|
-
backgroundColor: colors.card,
|
|
179
|
-
borderColor: colors.border
|
|
180
|
-
}],
|
|
181
|
-
children: recoveryCodes.map((code, idx) => /*#__PURE__*/_jsx(Text, {
|
|
182
|
-
style: [styles.codeText, {
|
|
183
|
-
color: colors.text
|
|
184
|
-
}],
|
|
185
|
-
children: code
|
|
186
|
-
}, idx))
|
|
187
|
-
})]
|
|
188
|
-
}), recoveryKey && /*#__PURE__*/_jsxs(View, {
|
|
189
|
-
style: styles.recoveryCodesContainer,
|
|
190
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
191
|
-
style: [styles.recoveryLabel, {
|
|
192
|
-
color: colors.text
|
|
193
|
-
}],
|
|
194
|
-
children: "Recovery Key"
|
|
195
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
196
|
-
style: [styles.codesBox, {
|
|
197
|
-
backgroundColor: colors.card,
|
|
198
|
-
borderColor: colors.border
|
|
199
|
-
}],
|
|
200
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
201
|
-
style: [styles.codeText, {
|
|
202
|
-
color: colors.text
|
|
203
|
-
}],
|
|
204
|
-
children: recoveryKey
|
|
205
|
-
})
|
|
206
|
-
})]
|
|
207
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
208
|
-
style: [styles.primaryButton, {
|
|
209
|
-
backgroundColor: colors.tint
|
|
210
|
-
}],
|
|
211
|
-
onPress: () => {
|
|
212
|
-
setShowRecoveryCodes(false);
|
|
213
|
-
onSave?.();
|
|
214
|
-
onClose();
|
|
215
|
-
},
|
|
216
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
217
|
-
style: styles.primaryButtonText,
|
|
218
|
-
children: t('editProfile.items.twoFactor.saved') || 'I saved them'
|
|
219
|
-
})
|
|
220
|
-
})]
|
|
221
|
-
}) : isEnabled ? /*#__PURE__*/_jsxs(View, {
|
|
222
|
-
style: styles.disableSection,
|
|
223
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
224
|
-
style: [styles.description, {
|
|
225
|
-
color: colors.secondaryText
|
|
226
|
-
}],
|
|
227
|
-
children: t('editProfile.items.twoFactor.disableDescription') || 'Two‑Factor Authentication is currently enabled. To disable, enter a code from your authenticator app.'
|
|
228
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
229
|
-
style: styles.inputGroup,
|
|
230
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
231
|
-
style: [styles.label, {
|
|
232
|
-
color: colors.text
|
|
233
|
-
}],
|
|
234
|
-
children: t('editProfile.items.twoFactor.enterCode') || 'Enter 6‑digit code'
|
|
235
|
-
}), /*#__PURE__*/_jsx(TextInput, {
|
|
236
|
-
style: [styles.input, {
|
|
237
|
-
backgroundColor: colors.card,
|
|
238
|
-
color: colors.text,
|
|
239
|
-
borderColor: colors.border
|
|
240
|
-
}],
|
|
241
|
-
value: totpCode,
|
|
242
|
-
onChangeText: setTotpCode,
|
|
243
|
-
placeholder: "123456",
|
|
244
|
-
placeholderTextColor: colors.secondaryText,
|
|
245
|
-
keyboardType: "number-pad",
|
|
246
|
-
maxLength: 6,
|
|
247
|
-
selectionColor: colors.tint
|
|
248
|
-
})]
|
|
249
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
250
|
-
style: [styles.primaryButton, {
|
|
251
|
-
backgroundColor: '#FF3B30'
|
|
252
|
-
}],
|
|
253
|
-
disabled: isBusy || totpCode.length !== 6,
|
|
254
|
-
onPress: handleDisable,
|
|
255
|
-
children: isBusy ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
256
|
-
size: "small",
|
|
257
|
-
color: "#fff"
|
|
258
|
-
}) : /*#__PURE__*/_jsx(Text, {
|
|
259
|
-
style: styles.primaryButtonText,
|
|
260
|
-
children: t('editProfile.items.twoFactor.disable') || 'Disable'
|
|
261
|
-
})
|
|
262
|
-
})]
|
|
263
|
-
}) : /*#__PURE__*/_jsxs(View, {
|
|
264
|
-
style: styles.enableSection,
|
|
265
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
266
|
-
style: [styles.description, {
|
|
267
|
-
color: colors.secondaryText
|
|
268
|
-
}],
|
|
269
|
-
children: t('editProfile.items.twoFactor.description') || 'Protect your account with a 6‑digit code from an authenticator app. Scan the QR code then enter the code to enable.'
|
|
270
|
-
}), !totpSetupUrl ? /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
271
|
-
style: [styles.primaryButton, {
|
|
272
|
-
backgroundColor: colors.tint
|
|
273
|
-
}],
|
|
274
|
-
disabled: isBusy,
|
|
275
|
-
onPress: handleGenerateQR,
|
|
276
|
-
children: isBusy ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
277
|
-
size: "small",
|
|
278
|
-
color: "#fff"
|
|
279
|
-
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
280
|
-
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
281
|
-
name: "shield-checkmark",
|
|
282
|
-
size: 18,
|
|
283
|
-
color: "#fff"
|
|
284
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
285
|
-
style: styles.primaryButtonText,
|
|
286
|
-
children: t('editProfile.items.twoFactor.generateQR') || 'Generate QR Code'
|
|
287
|
-
})]
|
|
288
|
-
})
|
|
289
|
-
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
290
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
291
|
-
style: [styles.qrContainer, {
|
|
292
|
-
backgroundColor: '#fff'
|
|
293
|
-
}],
|
|
294
|
-
children: /*#__PURE__*/_jsx(QRCode, {
|
|
295
|
-
value: totpSetupUrl,
|
|
296
|
-
size: 180
|
|
297
|
-
})
|
|
298
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
299
|
-
style: styles.inputGroup,
|
|
300
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
301
|
-
style: [styles.label, {
|
|
302
|
-
color: colors.text
|
|
303
|
-
}],
|
|
304
|
-
children: t('editProfile.items.twoFactor.enterCode') || 'Enter 6‑digit code'
|
|
305
|
-
}), /*#__PURE__*/_jsx(TextInput, {
|
|
306
|
-
style: [styles.input, {
|
|
307
|
-
backgroundColor: colors.card,
|
|
308
|
-
color: colors.text,
|
|
309
|
-
borderColor: colors.border
|
|
310
|
-
}],
|
|
311
|
-
value: totpCode,
|
|
312
|
-
onChangeText: setTotpCode,
|
|
313
|
-
placeholder: "123456",
|
|
314
|
-
placeholderTextColor: colors.secondaryText,
|
|
315
|
-
keyboardType: "number-pad",
|
|
316
|
-
maxLength: 6,
|
|
317
|
-
selectionColor: colors.tint
|
|
318
|
-
})]
|
|
319
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
320
|
-
style: [styles.primaryButton, {
|
|
321
|
-
backgroundColor: colors.tint
|
|
322
|
-
}],
|
|
323
|
-
disabled: isBusy || totpCode.length !== 6,
|
|
324
|
-
onPress: handleVerify,
|
|
325
|
-
children: isBusy ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
326
|
-
size: "small",
|
|
327
|
-
color: "#fff"
|
|
328
|
-
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
329
|
-
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
330
|
-
name: "checkmark-circle",
|
|
331
|
-
size: 18,
|
|
332
|
-
color: "#fff"
|
|
333
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
334
|
-
style: styles.primaryButtonText,
|
|
335
|
-
children: t('editProfile.items.twoFactor.verify') || 'Verify & Enable'
|
|
336
|
-
})]
|
|
337
|
-
})
|
|
338
|
-
})]
|
|
339
|
-
})]
|
|
340
|
-
})
|
|
341
|
-
})]
|
|
342
|
-
})
|
|
343
|
-
})
|
|
344
|
-
});
|
|
345
|
-
};
|
|
346
|
-
const styles = StyleSheet.create({
|
|
347
|
-
modalOverlay: {
|
|
348
|
-
flex: 1,
|
|
349
|
-
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
350
|
-
justifyContent: 'flex-end'
|
|
351
|
-
},
|
|
352
|
-
modalContent: {
|
|
353
|
-
borderTopLeftRadius: 20,
|
|
354
|
-
borderTopRightRadius: 20,
|
|
355
|
-
paddingTop: Platform.OS === 'ios' ? 20 : 16,
|
|
356
|
-
maxHeight: '80%'
|
|
357
|
-
},
|
|
358
|
-
modalHeader: {
|
|
359
|
-
flexDirection: 'row',
|
|
360
|
-
alignItems: 'center',
|
|
361
|
-
justifyContent: 'space-between',
|
|
362
|
-
paddingHorizontal: 16,
|
|
363
|
-
paddingBottom: 16,
|
|
364
|
-
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
365
|
-
borderBottomColor: '#E5E5EA'
|
|
366
|
-
},
|
|
367
|
-
closeButton: {
|
|
368
|
-
width: 40,
|
|
369
|
-
height: 40,
|
|
370
|
-
alignItems: 'center',
|
|
371
|
-
justifyContent: 'center'
|
|
372
|
-
},
|
|
373
|
-
modalTitle: {
|
|
374
|
-
fontSize: 18,
|
|
375
|
-
fontWeight: '600',
|
|
376
|
-
fontFamily: fontFamilies.phuduSemiBold,
|
|
377
|
-
flex: 1,
|
|
378
|
-
textAlign: 'center'
|
|
379
|
-
},
|
|
380
|
-
modalBody: {
|
|
381
|
-
padding: 16
|
|
382
|
-
},
|
|
383
|
-
enableSection: {
|
|
384
|
-
gap: 24,
|
|
385
|
-
alignItems: 'center'
|
|
386
|
-
},
|
|
387
|
-
disableSection: {
|
|
388
|
-
gap: 24
|
|
389
|
-
},
|
|
390
|
-
recoverySection: {
|
|
391
|
-
gap: 24
|
|
392
|
-
},
|
|
393
|
-
sectionTitle: {
|
|
394
|
-
fontSize: 20,
|
|
395
|
-
fontWeight: '700',
|
|
396
|
-
fontFamily: fontFamilies.phuduBold
|
|
397
|
-
},
|
|
398
|
-
description: {
|
|
399
|
-
fontSize: 14,
|
|
400
|
-
lineHeight: 20
|
|
401
|
-
},
|
|
402
|
-
qrContainer: {
|
|
403
|
-
padding: 16,
|
|
404
|
-
borderRadius: 16,
|
|
405
|
-
alignItems: 'center',
|
|
406
|
-
justifyContent: 'center'
|
|
407
|
-
},
|
|
408
|
-
inputGroup: {
|
|
409
|
-
width: '100%',
|
|
410
|
-
gap: 8
|
|
411
|
-
},
|
|
412
|
-
label: {
|
|
413
|
-
fontSize: 14,
|
|
414
|
-
fontWeight: '600',
|
|
415
|
-
fontFamily: fontFamilies.phuduSemiBold
|
|
416
|
-
},
|
|
417
|
-
input: {
|
|
418
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
419
|
-
borderRadius: 12,
|
|
420
|
-
padding: 16,
|
|
421
|
-
fontSize: 16,
|
|
422
|
-
minHeight: 52,
|
|
423
|
-
textAlign: 'center'
|
|
424
|
-
},
|
|
425
|
-
primaryButton: {
|
|
426
|
-
flexDirection: 'row',
|
|
427
|
-
alignItems: 'center',
|
|
428
|
-
justifyContent: 'center',
|
|
429
|
-
gap: 8,
|
|
430
|
-
paddingVertical: 12,
|
|
431
|
-
paddingHorizontal: 16,
|
|
432
|
-
borderRadius: 12,
|
|
433
|
-
width: '100%'
|
|
434
|
-
},
|
|
435
|
-
primaryButtonText: {
|
|
436
|
-
color: '#fff',
|
|
437
|
-
fontSize: 16,
|
|
438
|
-
fontWeight: '600',
|
|
439
|
-
fontFamily: fontFamilies.phuduSemiBold
|
|
440
|
-
},
|
|
441
|
-
recoveryCodesContainer: {
|
|
442
|
-
gap: 8
|
|
443
|
-
},
|
|
444
|
-
recoveryLabel: {
|
|
445
|
-
fontSize: 16,
|
|
446
|
-
fontWeight: '600',
|
|
447
|
-
fontFamily: fontFamilies.phuduSemiBold
|
|
448
|
-
},
|
|
449
|
-
codesBox: {
|
|
450
|
-
padding: 16,
|
|
451
|
-
borderRadius: 12,
|
|
452
|
-
borderWidth: StyleSheet.hairlineWidth,
|
|
453
|
-
gap: 8
|
|
454
|
-
},
|
|
455
|
-
codeText: {
|
|
456
|
-
fontSize: 14,
|
|
457
|
-
fontFamily: Platform.OS === 'web' ? 'monospace' : 'monospace'
|
|
458
|
-
}
|
|
459
|
-
});
|
|
460
|
-
//# sourceMappingURL=TwoFactorSetupModal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","useEffect","View","Text","TextInput","TouchableOpacity","StyleSheet","Modal","Platform","ScrollView","ActivityIndicator","Ionicons","QRCode","useThemeStyles","useColorScheme","useI18n","fontFamilies","useOxy","useAuthStore","toast","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","TwoFactorSetupModal","visible","onClose","isEnabled","theme","onSave","t","colorScheme","themeStyles","colors","oxyServices","activeSessionId","updateUser","state","totpSetupUrl","setTotpSetupUrl","totpCode","setTotpCode","isBusy","setIsBusy","showRecoveryCodes","setShowRecoveryCodes","recoveryCodes","setRecoveryCodes","recoveryKey","setRecoveryKey","handleGenerateQR","error","otpauthUrl","startTotpEnrollment","e","message","handleVerify","length","result","verifyTotpEnrollment","privacySettings","twoFactorEnabled","backupCodes","success","handleDisable","animationType","transparent","onRequestClose","children","style","styles","modalOverlay","modalContent","backgroundColor","background","modalHeader","onPress","closeButton","name","size","color","text","modalTitle","width","modalBody","recoverySection","sectionTitle","description","secondaryText","recoveryCodesContainer","recoveryLabel","codesBox","card","borderColor","border","map","code","idx","codeText","primaryButton","tint","primaryButtonText","disableSection","inputGroup","label","input","value","onChangeText","placeholder","placeholderTextColor","keyboardType","maxLength","selectionColor","disabled","enableSection","qrContainer","create","flex","justifyContent","borderTopLeftRadius","borderTopRightRadius","paddingTop","OS","maxHeight","flexDirection","alignItems","paddingHorizontal","paddingBottom","borderBottomWidth","hairlineWidth","borderBottomColor","height","fontSize","fontWeight","fontFamily","phuduSemiBold","textAlign","padding","gap","phuduBold","lineHeight","borderRadius","borderWidth","minHeight","paddingVertical"],"sourceRoot":"../../../../../src","sources":["ui/components/profile/TwoFactorSetupModal.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAClD,SACIC,IAAI,EACJC,IAAI,EACJC,SAAS,EACTC,gBAAgB,EAChBC,UAAU,EACVC,KAAK,EACLC,QAAQ,EACRC,UAAU,EACVC,iBAAiB,QACd,cAAc;AACrB,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,OAAOC,MAAM,MAAM,yBAAyB;AAC5C,SAASC,cAAc,QAAQ,4BAA4B;AAC3D,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,OAAO,QAAQ,qBAAqB;AAC7C,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,MAAM,QAAQ,0BAA0B;AACjD,SAASC,YAAY,QAAQ,wBAAwB;AACrD,SAASC,KAAK,QAAQ,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAU5C,OAAO,MAAMC,mBAAuD,GAAGA,CAAC;EACpEC,OAAO;EACPC,OAAO;EACPC,SAAS;EACTC,KAAK,GAAG,OA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AAC;EACDrC,aAAa,EAAE;IACXyB,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBP,cAAc,EAAE,QAAQ;IACxBoB,GAAG,EAAE,CAAC;IACNM,eAAe,EAAE,EAAE;IACnBlB,iBAAiB,EAAE,EAAE;IACrBe,YAAY,EAAE,EAAE;IAChB1D,KAAK,EAAE;EACX,CAAC;EACDkB,iBAAiB,EAAE;IACfrB,KAAK,EAAE,MAAM;IACboD,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,UAAU,EAAExH,YAAY,CAACyH;EAC7B,CAAC;EACD9C,sBAAsB,EAAE;IACpBiD,GAAG,EAAE;EACT,CAAC;EACDhD,aAAa,EAAE;IACX0C,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,UAAU,EAAExH,YAAY,CAACyH;EAC7B,CAAC;EACD5C,QAAQ,EAAE;IACN8C,OAAO,EAAE,EAAE;IACXI,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAE1I,UAAU,CAAC6H,aAAa;IACrCS,GAAG,EAAE;EACT,CAAC;EACDxC,QAAQ,EAAE;IACNkC,QAAQ,EAAE,EAAE;IACZE,UAAU,EAAEhI,QAAQ,CAACoH,EAAE,KAAK,KAAK,GAAG,WAAW,GAAU;EAC7D;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TOTP Enrollment Methods Mixin
|
|
3
|
-
*/
|
|
4
|
-
import type { OxyServicesBase } from '../OxyServices.base';
|
|
5
|
-
export declare function OxyServicesTotpMixin<T extends typeof OxyServicesBase>(Base: T): {
|
|
6
|
-
new (...args: any[]): {
|
|
7
|
-
startTotpEnrollment(sessionId: string): Promise<{
|
|
8
|
-
secret: string;
|
|
9
|
-
otpauthUrl: string;
|
|
10
|
-
issuer: string;
|
|
11
|
-
label: string;
|
|
12
|
-
}>;
|
|
13
|
-
verifyTotpEnrollment(sessionId: string, code: string): Promise<{
|
|
14
|
-
enabled: boolean;
|
|
15
|
-
backupCodes?: string[];
|
|
16
|
-
recoveryKey?: string;
|
|
17
|
-
}>;
|
|
18
|
-
disableTotp(sessionId: string, code: string): Promise<{
|
|
19
|
-
disabled: boolean;
|
|
20
|
-
}>;
|
|
21
|
-
httpService: import("../HttpService").HttpService;
|
|
22
|
-
cloudURL: string;
|
|
23
|
-
config: import("../OxyServices.base").OxyConfig;
|
|
24
|
-
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
25
|
-
getBaseURL(): string;
|
|
26
|
-
getClient(): import("../HttpService").HttpService;
|
|
27
|
-
getMetrics(): {
|
|
28
|
-
totalRequests: number;
|
|
29
|
-
successfulRequests: number;
|
|
30
|
-
failedRequests: number;
|
|
31
|
-
cacheHits: number;
|
|
32
|
-
cacheMisses: number;
|
|
33
|
-
averageResponseTime: number;
|
|
34
|
-
};
|
|
35
|
-
clearCache(): void;
|
|
36
|
-
clearCacheEntry(key: string): void;
|
|
37
|
-
getCacheStats(): {
|
|
38
|
-
size: number;
|
|
39
|
-
hits: number;
|
|
40
|
-
misses: number;
|
|
41
|
-
hitRate: number;
|
|
42
|
-
};
|
|
43
|
-
getCloudURL(): string;
|
|
44
|
-
setTokens(accessToken: string, refreshToken?: string): void;
|
|
45
|
-
clearTokens(): void;
|
|
46
|
-
getCurrentUserId(): string | null;
|
|
47
|
-
hasValidToken(): boolean;
|
|
48
|
-
getAccessToken(): string | null;
|
|
49
|
-
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
50
|
-
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
51
|
-
maxRetries?: number;
|
|
52
|
-
retryDelay?: number;
|
|
53
|
-
authTimeoutMs?: number;
|
|
54
|
-
}): Promise<T_1>;
|
|
55
|
-
validate(): Promise<boolean>;
|
|
56
|
-
handleError(error: unknown): Error;
|
|
57
|
-
healthCheck(): Promise<{
|
|
58
|
-
status: string;
|
|
59
|
-
users?: number;
|
|
60
|
-
timestamp?: string;
|
|
61
|
-
[key: string]: any;
|
|
62
|
-
}>;
|
|
63
|
-
};
|
|
64
|
-
__resetTokensForTests(): void;
|
|
65
|
-
} & T;
|
|
66
|
-
//# sourceMappingURL=OxyServices.totp.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OxyServices.totp.d.ts","sourceRoot":"","sources":["../../../../src/core/mixins/OxyServices.totp.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,OAAO,eAAe,EAAE,IAAI,EAAE,CAAC;kBAErD,GAAG,EAAE;uCAGW,MAAM,GAAG,OAAO,CAAC;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC;wCAQtF,MAAM,QAAQ,MAAM,GAAG,OAAO,CAAC;YAAE,OAAO,EAAE,OAAO,CAAC;YAAC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;YAAC,WAAW,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;+BAQ3G,MAAM,QAAQ,MAAM,GAAG,OAAO,CAAC;YAAE,QAAQ,EAAE,OAAO,CAAA;SAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAUsjJ,CAAC;sBAA0B,CAAC;yBAA6B,CAAC;;;;;;iBAAuhG,CAAC;qBAAwB,CAAC;;;;;MAFtvP"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface TwoFactorSetupModalProps {
|
|
3
|
-
visible: boolean;
|
|
4
|
-
onClose: () => void;
|
|
5
|
-
isEnabled: boolean;
|
|
6
|
-
theme?: 'light' | 'dark';
|
|
7
|
-
onSave?: () => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const TwoFactorSetupModal: React.FC<TwoFactorSetupModalProps>;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=TwoFactorSetupModal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TwoFactorSetupModal.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/profile/TwoFactorSetupModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAsBnD,UAAU,wBAAwB;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAgSlE,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TOTP Enrollment Methods Mixin
|
|
3
|
-
*/
|
|
4
|
-
import type { OxyServicesBase } from '../OxyServices.base';
|
|
5
|
-
|
|
6
|
-
export function OxyServicesTotpMixin<T extends typeof OxyServicesBase>(Base: T) {
|
|
7
|
-
return class extends Base {
|
|
8
|
-
constructor(...args: any[]) {
|
|
9
|
-
super(...(args as [any]));
|
|
10
|
-
}
|
|
11
|
-
async startTotpEnrollment(sessionId: string): Promise<{ secret: string; otpauthUrl: string; issuer: string; label: string }> {
|
|
12
|
-
try {
|
|
13
|
-
return await this.makeRequest('POST', '/api/auth/totp/enroll/start', { sessionId }, { cache: false });
|
|
14
|
-
} catch (error) {
|
|
15
|
-
throw this.handleError(error);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
async verifyTotpEnrollment(sessionId: string, code: string): Promise<{ enabled: boolean; backupCodes?: string[]; recoveryKey?: string }> {
|
|
20
|
-
try {
|
|
21
|
-
return await this.makeRequest('POST', '/api/auth/totp/enroll/verify', { sessionId, code }, { cache: false });
|
|
22
|
-
} catch (error) {
|
|
23
|
-
throw this.handleError(error);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async disableTotp(sessionId: string, code: string): Promise<{ disabled: boolean }> {
|
|
28
|
-
try {
|
|
29
|
-
return await this.makeRequest('POST', '/api/auth/totp/disable', { sessionId, code }, { cache: false });
|
|
30
|
-
} catch (error) {
|
|
31
|
-
throw this.handleError(error);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|