@dynamic-labs/sdk-react-core 3.0.0-alpha.2 → 3.0.0-alpha.3
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/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
## [3.0.0-alpha.3](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.2...v3.0.0-alpha.3) (2024-06-11)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* only navigate to mfa backup codes when needed ([#5965](https://github.com/dynamic-labs/DynamicAuth/issues/5965)) ([edc462f](https://github.com/dynamic-labs/DynamicAuth/commit/edc462f20768885db1883a2c8d005e07044092d5))
|
|
8
|
+
|
|
2
9
|
## [3.0.0-alpha.2](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.1...v3.0.0-alpha.2) (2024-06-11)
|
|
3
10
|
|
|
4
11
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -17,18 +17,18 @@
|
|
|
17
17
|
"react-i18next": "13.5.0",
|
|
18
18
|
"yup": "0.32.11",
|
|
19
19
|
"react-international-phone": "4.2.5",
|
|
20
|
-
"@dynamic-labs/iconic": "3.0.0-alpha.
|
|
21
|
-
"@dynamic-labs/logger": "3.0.0-alpha.
|
|
22
|
-
"@dynamic-labs/multi-wallet": "3.0.0-alpha.
|
|
23
|
-
"@dynamic-labs/rpc-provider-ethereum": "3.0.0-alpha.
|
|
24
|
-
"@dynamic-labs/rpc-provider-solana": "3.0.0-alpha.
|
|
25
|
-
"@dynamic-labs/rpc-providers": "3.0.0-alpha.
|
|
26
|
-
"@dynamic-labs/store": "3.0.0-alpha.
|
|
27
|
-
"@dynamic-labs/types": "3.0.0-alpha.
|
|
28
|
-
"@dynamic-labs/utils": "3.0.0-alpha.
|
|
29
|
-
"@dynamic-labs/viem-utils": "3.0.0-alpha.
|
|
30
|
-
"@dynamic-labs/wallet-book": "3.0.0-alpha.
|
|
31
|
-
"@dynamic-labs/wallet-connector-core": "3.0.0-alpha.
|
|
20
|
+
"@dynamic-labs/iconic": "3.0.0-alpha.3",
|
|
21
|
+
"@dynamic-labs/logger": "3.0.0-alpha.3",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "3.0.0-alpha.3",
|
|
23
|
+
"@dynamic-labs/rpc-provider-ethereum": "3.0.0-alpha.3",
|
|
24
|
+
"@dynamic-labs/rpc-provider-solana": "3.0.0-alpha.3",
|
|
25
|
+
"@dynamic-labs/rpc-providers": "3.0.0-alpha.3",
|
|
26
|
+
"@dynamic-labs/store": "3.0.0-alpha.3",
|
|
27
|
+
"@dynamic-labs/types": "3.0.0-alpha.3",
|
|
28
|
+
"@dynamic-labs/utils": "3.0.0-alpha.3",
|
|
29
|
+
"@dynamic-labs/viem-utils": "3.0.0-alpha.3",
|
|
30
|
+
"@dynamic-labs/wallet-book": "3.0.0-alpha.3",
|
|
31
|
+
"@dynamic-labs/wallet-connector-core": "3.0.0-alpha.3",
|
|
32
32
|
"eventemitter3": "5.0.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
@@ -8,14 +8,17 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var reactI18next = require('react-i18next');
|
|
10
10
|
var utils = require('@dynamic-labs/utils');
|
|
11
|
+
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
11
12
|
var OTPVerificationView = require('../../components/OTPVerificationView/OTPVerificationView.cjs');
|
|
12
13
|
require('../../events/dynamicEvents.cjs');
|
|
14
|
+
var useDynamicContext = require('../../context/DynamicContext/useDynamicContext/useDynamicContext.cjs');
|
|
13
15
|
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
14
|
-
require('@dynamic-labs/sdk-api-core');
|
|
15
|
-
require('../../shared/logger.cjs');
|
|
16
|
-
require('@dynamic-labs/iconic');
|
|
17
16
|
require('@dynamic-labs/wallet-connector-core');
|
|
17
|
+
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
18
|
+
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
18
19
|
var ViewContext = require('../../context/ViewContext/ViewContext.cjs');
|
|
20
|
+
require('../../shared/logger.cjs');
|
|
21
|
+
require('@dynamic-labs/iconic');
|
|
19
22
|
var passwordHero = require('../../shared/assets/password-hero.cjs');
|
|
20
23
|
require('@dynamic-labs/wallet-book');
|
|
21
24
|
require('../../utils/constants/colors.cjs');
|
|
@@ -23,8 +26,6 @@ require('../../utils/constants/values.cjs');
|
|
|
23
26
|
require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
24
27
|
require('../../shared/utils/classes/storage/sessionStorage.cjs');
|
|
25
28
|
require('../../shared/consts/index.cjs');
|
|
26
|
-
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
27
|
-
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
28
29
|
require('@dynamic-labs/multi-wallet');
|
|
29
30
|
require('react-international-phone');
|
|
30
31
|
require('../../config/ApiEndpoint.cjs');
|
|
@@ -84,6 +85,7 @@ require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/
|
|
|
84
85
|
|
|
85
86
|
const MfaVerificationView = ({ type }) => {
|
|
86
87
|
const { t } = reactI18next.useTranslation();
|
|
88
|
+
const { user } = useDynamicContext.useDynamicContext();
|
|
87
89
|
const { setView } = ViewContext.useViewContext();
|
|
88
90
|
const { authDevice } = useMfa.useMfa();
|
|
89
91
|
const [code, setCode] = React.useState('');
|
|
@@ -95,8 +97,10 @@ const MfaVerificationView = ({ type }) => {
|
|
|
95
97
|
setError(new utils.DynamicError(t('dyn_mfa.otp_verification_view.error')));
|
|
96
98
|
},
|
|
97
99
|
onResolve: () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
if ((user === null || user === void 0 ? void 0 : user.mfaBackupCodeAcknowledgement) !==
|
|
101
|
+
sdkApiCore.MfaBackupCodeAcknowledgement.Complete) {
|
|
102
|
+
setView('mfa-display-backup-codes');
|
|
103
|
+
}
|
|
100
104
|
}),
|
|
101
105
|
});
|
|
102
106
|
const onCodeChange = (code) => {
|
|
@@ -3,15 +3,18 @@ import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { useState } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { DynamicError
|
|
6
|
+
import { DynamicError } from '@dynamic-labs/utils';
|
|
7
|
+
import { MfaBackupCodeAcknowledgement } from '@dynamic-labs/sdk-api-core';
|
|
7
8
|
import { OTPVerificationView } from '../../components/OTPVerificationView/OTPVerificationView.js';
|
|
8
9
|
import '../../events/dynamicEvents.js';
|
|
10
|
+
import { useDynamicContext } from '../../context/DynamicContext/useDynamicContext/useDynamicContext.js';
|
|
9
11
|
import '../../context/DynamicContext/DynamicContext.js';
|
|
10
|
-
import '@dynamic-labs/sdk-api-core';
|
|
11
|
-
import '../../shared/logger.js';
|
|
12
|
-
import '@dynamic-labs/iconic';
|
|
13
12
|
import '@dynamic-labs/wallet-connector-core';
|
|
13
|
+
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
14
|
+
import '../../context/ErrorContext/ErrorContext.js';
|
|
14
15
|
import { useViewContext } from '../../context/ViewContext/ViewContext.js';
|
|
16
|
+
import '../../shared/logger.js';
|
|
17
|
+
import '@dynamic-labs/iconic';
|
|
15
18
|
import { ReactComponent as SvgPasswordHero } from '../../shared/assets/password-hero.js';
|
|
16
19
|
import '@dynamic-labs/wallet-book';
|
|
17
20
|
import '../../utils/constants/colors.js';
|
|
@@ -19,8 +22,6 @@ import '../../utils/constants/values.js';
|
|
|
19
22
|
import '../../shared/utils/classes/storage/localStorage.js';
|
|
20
23
|
import '../../shared/utils/classes/storage/sessionStorage.js';
|
|
21
24
|
import '../../shared/consts/index.js';
|
|
22
|
-
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
23
|
-
import '../../context/ErrorContext/ErrorContext.js';
|
|
24
25
|
import '@dynamic-labs/multi-wallet';
|
|
25
26
|
import 'react-international-phone';
|
|
26
27
|
import '../../config/ApiEndpoint.js';
|
|
@@ -80,6 +81,7 @@ import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/P
|
|
|
80
81
|
|
|
81
82
|
const MfaVerificationView = ({ type }) => {
|
|
82
83
|
const { t } = useTranslation();
|
|
84
|
+
const { user } = useDynamicContext();
|
|
83
85
|
const { setView } = useViewContext();
|
|
84
86
|
const { authDevice } = useMfa();
|
|
85
87
|
const [code, setCode] = useState('');
|
|
@@ -91,8 +93,10 @@ const MfaVerificationView = ({ type }) => {
|
|
|
91
93
|
setError(new DynamicError(t('dyn_mfa.otp_verification_view.error')));
|
|
92
94
|
},
|
|
93
95
|
onResolve: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
if ((user === null || user === void 0 ? void 0 : user.mfaBackupCodeAcknowledgement) !==
|
|
97
|
+
MfaBackupCodeAcknowledgement.Complete) {
|
|
98
|
+
setView('mfa-display-backup-codes');
|
|
99
|
+
}
|
|
96
100
|
}),
|
|
97
101
|
});
|
|
98
102
|
const onCodeChange = (code) => {
|