@dynamic-labs/sdk-react-core 4.52.4 → 4.52.5
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 +14 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +12 -12
- package/src/lib/utils/hooks/useAuthenticatePasskeyMFA/useAuthenticatePasskeyMFA.cjs +26 -7
- package/src/lib/utils/hooks/useAuthenticatePasskeyMFA/useAuthenticatePasskeyMFA.js +26 -7
- package/src/lib/utils/hooks/useRegisterPasskey/useRegisterPasskey.cjs +25 -7
- package/src/lib/utils/hooks/useRegisterPasskey/useRegisterPasskey.js +25 -7
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +11 -1
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +11 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.52.5](https://github.com/dynamic-labs/dynamic-auth/compare/v4.52.4...v4.52.5) (2026-01-08)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add generate ton connect proof method to demo v2 ([#9989](https://github.com/dynamic-labs/dynamic-auth/issues/9989)) ([9727e2e](https://github.com/dynamic-labs/dynamic-auth/commit/9727e2e25742c4a2b0345c8c4a83159cc88892d7))
|
|
8
|
+
* add waas ton to demo v2 ([#9988](https://github.com/dynamic-labs/dynamic-auth/issues/9988)) ([8edda43](https://github.com/dynamic-labs/dynamic-auth/commit/8edda43aeb58b5a77aef197d6cf20c1b633d1610))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* trigger onAuthSuccess callback for passkey MFA flows ([#10174](https://github.com/dynamic-labs/dynamic-auth/issues/10174)) ([a37753a](https://github.com/dynamic-labs/dynamic-auth/commit/a37753afd6f3b814198d2acf6dc267feb11021e2))
|
|
14
|
+
* **wallet-book:** add mobile app IDs for Binance Wallet to fix mobile filtering ([#10176](https://github.com/dynamic-labs/dynamic-auth/issues/10176)) ([010a48f](https://github.com/dynamic-labs/dynamic-auth/commit/010a48fd28a49861a26b9188babe4a174cefeedb))
|
|
15
|
+
|
|
2
16
|
### [4.52.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.52.3...v4.52.4) (2026-01-07)
|
|
3
17
|
|
|
4
18
|
### [4.52.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.52.2...v4.52.3) (2026-01-06)
|
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": "4.52.
|
|
3
|
+
"version": "4.52.5",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.843",
|
|
6
6
|
"@dynamic-labs-sdk/client": "0.1.2",
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
"yup": "0.32.11",
|
|
16
16
|
"react-international-phone": "4.5.0",
|
|
17
17
|
"bs58": "5.0.0",
|
|
18
|
-
"@dynamic-labs/assert-package-version": "4.52.
|
|
19
|
-
"@dynamic-labs/iconic": "4.52.
|
|
20
|
-
"@dynamic-labs/locale": "4.52.
|
|
21
|
-
"@dynamic-labs/logger": "4.52.
|
|
22
|
-
"@dynamic-labs/multi-wallet": "4.52.
|
|
23
|
-
"@dynamic-labs/rpc-providers": "4.52.
|
|
24
|
-
"@dynamic-labs/store": "4.52.
|
|
25
|
-
"@dynamic-labs/types": "4.52.
|
|
26
|
-
"@dynamic-labs/utils": "4.52.
|
|
27
|
-
"@dynamic-labs/wallet-book": "4.52.
|
|
28
|
-
"@dynamic-labs/wallet-connector-core": "4.52.
|
|
18
|
+
"@dynamic-labs/assert-package-version": "4.52.5",
|
|
19
|
+
"@dynamic-labs/iconic": "4.52.5",
|
|
20
|
+
"@dynamic-labs/locale": "4.52.5",
|
|
21
|
+
"@dynamic-labs/logger": "4.52.5",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "4.52.5",
|
|
23
|
+
"@dynamic-labs/rpc-providers": "4.52.5",
|
|
24
|
+
"@dynamic-labs/store": "4.52.5",
|
|
25
|
+
"@dynamic-labs/types": "4.52.5",
|
|
26
|
+
"@dynamic-labs/utils": "4.52.5",
|
|
27
|
+
"@dynamic-labs/wallet-book": "4.52.5",
|
|
28
|
+
"@dynamic-labs/wallet-connector-core": "4.52.5",
|
|
29
29
|
"eventemitter3": "5.0.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
@@ -7,6 +7,7 @@ var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var client = require('@dynamic-labs-sdk/client');
|
|
9
9
|
var dynamicEvents = require('../../../events/dynamicEvents.cjs');
|
|
10
|
+
var useUserAuth = require('../useUserAuth/useUserAuth.cjs');
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Authenticate passkey for MFA
|
|
@@ -30,12 +31,30 @@ var dynamicEvents = require('../../../events/dynamicEvents.cjs');
|
|
|
30
31
|
* );
|
|
31
32
|
* }
|
|
32
33
|
*/
|
|
33
|
-
const useAuthenticatePasskeyMFA = () =>
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
mfaToken
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
const useAuthenticatePasskeyMFA = () => {
|
|
35
|
+
const { completeAuth } = useUserAuth.useUserAuth({});
|
|
36
|
+
return React.useCallback((props) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
+
let mfaToken = undefined;
|
|
38
|
+
yield completeAuth({
|
|
39
|
+
updateJwtFunction: () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
+
const response = yield client.authenticatePasskeyMFA(props);
|
|
41
|
+
// eslint-disable-next-line prefer-destructuring
|
|
42
|
+
mfaToken = response.mfaToken;
|
|
43
|
+
dynamicEvents.dynamicEvents.emit('mfaCompletionSuccess', {
|
|
44
|
+
mfaToken: response.mfaToken,
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
isEmailVerificationRequired: false,
|
|
48
|
+
isSmsVerificationRequired: false,
|
|
49
|
+
missingFields: [],
|
|
50
|
+
// VerifyResponse is compatible with UpdateSelfResponse for MFA flows:
|
|
51
|
+
// Both types have: expiresAt, jwt, minifiedJwt, user (used in useUserAuth.ts:329-332)
|
|
52
|
+
updateUserProfileResponse: response,
|
|
53
|
+
};
|
|
54
|
+
}),
|
|
55
|
+
});
|
|
56
|
+
return mfaToken;
|
|
57
|
+
}), [completeAuth]);
|
|
58
|
+
};
|
|
40
59
|
|
|
41
60
|
exports.useAuthenticatePasskeyMFA = useAuthenticatePasskeyMFA;
|
|
@@ -3,6 +3,7 @@ import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import { authenticatePasskeyMFA } from '@dynamic-labs-sdk/client';
|
|
5
5
|
import { dynamicEvents } from '../../../events/dynamicEvents.js';
|
|
6
|
+
import { useUserAuth } from '../useUserAuth/useUserAuth.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Authenticate passkey for MFA
|
|
@@ -26,12 +27,30 @@ import { dynamicEvents } from '../../../events/dynamicEvents.js';
|
|
|
26
27
|
* );
|
|
27
28
|
* }
|
|
28
29
|
*/
|
|
29
|
-
const useAuthenticatePasskeyMFA = () =>
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
mfaToken
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
const useAuthenticatePasskeyMFA = () => {
|
|
31
|
+
const { completeAuth } = useUserAuth({});
|
|
32
|
+
return useCallback((props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
+
let mfaToken = undefined;
|
|
34
|
+
yield completeAuth({
|
|
35
|
+
updateJwtFunction: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
+
const response = yield authenticatePasskeyMFA(props);
|
|
37
|
+
// eslint-disable-next-line prefer-destructuring
|
|
38
|
+
mfaToken = response.mfaToken;
|
|
39
|
+
dynamicEvents.emit('mfaCompletionSuccess', {
|
|
40
|
+
mfaToken: response.mfaToken,
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
isEmailVerificationRequired: false,
|
|
44
|
+
isSmsVerificationRequired: false,
|
|
45
|
+
missingFields: [],
|
|
46
|
+
// VerifyResponse is compatible with UpdateSelfResponse for MFA flows:
|
|
47
|
+
// Both types have: expiresAt, jwt, minifiedJwt, user (used in useUserAuth.ts:329-332)
|
|
48
|
+
updateUserProfileResponse: response,
|
|
49
|
+
};
|
|
50
|
+
}),
|
|
51
|
+
});
|
|
52
|
+
return mfaToken;
|
|
53
|
+
}), [completeAuth]);
|
|
54
|
+
};
|
|
36
55
|
|
|
37
56
|
export { useAuthenticatePasskeyMFA };
|
|
@@ -7,6 +7,7 @@ var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var client = require('@dynamic-labs-sdk/client');
|
|
9
9
|
var dynamicEvents = require('../../../events/dynamicEvents.cjs');
|
|
10
|
+
var useUserAuth = require('../useUserAuth/useUserAuth.cjs');
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Register passkey
|
|
@@ -27,12 +28,29 @@ var dynamicEvents = require('../../../events/dynamicEvents.cjs');
|
|
|
27
28
|
* );
|
|
28
29
|
* }
|
|
29
30
|
*/
|
|
30
|
-
const useRegisterPasskey = () =>
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
const useRegisterPasskey = () => {
|
|
32
|
+
const { completeAuth } = useUserAuth.useUserAuth({});
|
|
33
|
+
return React.useCallback(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
+
let response;
|
|
35
|
+
yield completeAuth({
|
|
36
|
+
updateJwtFunction: () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
+
response = yield client.registerPasskey();
|
|
38
|
+
dynamicEvents.dynamicEvents.emit('mfaCompletionSuccess', {
|
|
39
|
+
mfaToken: response.mfaToken,
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
isEmailVerificationRequired: false,
|
|
43
|
+
isSmsVerificationRequired: false,
|
|
44
|
+
missingFields: [],
|
|
45
|
+
// VerifyResponse is compatible with UpdateSelfResponse for MFA flows
|
|
46
|
+
// Both types have: expiresAt, jwt, minifiedJwt, user (used in useUserAuth.ts:329-332)
|
|
47
|
+
updateUserProfileResponse: response,
|
|
48
|
+
};
|
|
49
|
+
}),
|
|
50
|
+
});
|
|
51
|
+
// @ts-expect-error - response is being set in the completeAuth function
|
|
52
|
+
return response;
|
|
53
|
+
}), [completeAuth]);
|
|
54
|
+
};
|
|
37
55
|
|
|
38
56
|
exports.useRegisterPasskey = useRegisterPasskey;
|
|
@@ -3,6 +3,7 @@ import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import { registerPasskey } from '@dynamic-labs-sdk/client';
|
|
5
5
|
import { dynamicEvents } from '../../../events/dynamicEvents.js';
|
|
6
|
+
import { useUserAuth } from '../useUserAuth/useUserAuth.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Register passkey
|
|
@@ -23,12 +24,29 @@ import { dynamicEvents } from '../../../events/dynamicEvents.js';
|
|
|
23
24
|
* );
|
|
24
25
|
* }
|
|
25
26
|
*/
|
|
26
|
-
const useRegisterPasskey = () =>
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
const useRegisterPasskey = () => {
|
|
28
|
+
const { completeAuth } = useUserAuth({});
|
|
29
|
+
return useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
30
|
+
let response;
|
|
31
|
+
yield completeAuth({
|
|
32
|
+
updateJwtFunction: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
+
response = yield registerPasskey();
|
|
34
|
+
dynamicEvents.emit('mfaCompletionSuccess', {
|
|
35
|
+
mfaToken: response.mfaToken,
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
isEmailVerificationRequired: false,
|
|
39
|
+
isSmsVerificationRequired: false,
|
|
40
|
+
missingFields: [],
|
|
41
|
+
// VerifyResponse is compatible with UpdateSelfResponse for MFA flows
|
|
42
|
+
// Both types have: expiresAt, jwt, minifiedJwt, user (used in useUserAuth.ts:329-332)
|
|
43
|
+
updateUserProfileResponse: response,
|
|
44
|
+
};
|
|
45
|
+
}),
|
|
46
|
+
});
|
|
47
|
+
// @ts-expect-error - response is being set in the completeAuth function
|
|
48
|
+
return response;
|
|
49
|
+
}), [completeAuth]);
|
|
50
|
+
};
|
|
33
51
|
|
|
34
52
|
export { useRegisterPasskey };
|
|
@@ -123,7 +123,7 @@ const useUserAuth = ({ authMethod, }) => {
|
|
|
123
123
|
clearStackAndPushInitialView();
|
|
124
124
|
}), [authMethod, clearStackAndPushInitialView, handleLogOut]);
|
|
125
125
|
const handleAuthError = React.useCallback((error, { options = {}, onError, }) => {
|
|
126
|
-
var _a;
|
|
126
|
+
var _a, _b;
|
|
127
127
|
if (error instanceof client.MfaInvalidOtpError ||
|
|
128
128
|
error instanceof client.MfaRateLimitedError) {
|
|
129
129
|
throw error;
|
|
@@ -160,6 +160,16 @@ const useUserAuth = ({ authMethod, }) => {
|
|
|
160
160
|
});
|
|
161
161
|
return;
|
|
162
162
|
}
|
|
163
|
+
// Re-throw passkey errors so they propagate to usePromise in the UI
|
|
164
|
+
// This allows error messages to be displayed in ConfirmPasskeyView
|
|
165
|
+
// WebAuthnError is the specific error type thrown by @simplewebauthn/browser
|
|
166
|
+
// for passkey operations (authentication/registration failures)
|
|
167
|
+
// NotAllowedError is the underlying DOMException when user cancels or times out
|
|
168
|
+
if ((error === null || error === void 0 ? void 0 : error.name) === 'NotAllowedError' &&
|
|
169
|
+
(((_b = error === null || error === void 0 ? void 0 : error.constructor) === null || _b === void 0 ? void 0 : _b.name) === 'WebAuthnError' ||
|
|
170
|
+
(error === null || error === void 0 ? void 0 : error.code) === 'ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY')) {
|
|
171
|
+
throw error;
|
|
172
|
+
}
|
|
163
173
|
if (onError) {
|
|
164
174
|
onError === null || onError === void 0 ? void 0 : onError(error);
|
|
165
175
|
return;
|
|
@@ -119,7 +119,7 @@ const useUserAuth = ({ authMethod, }) => {
|
|
|
119
119
|
clearStackAndPushInitialView();
|
|
120
120
|
}), [authMethod, clearStackAndPushInitialView, handleLogOut]);
|
|
121
121
|
const handleAuthError = useCallback((error, { options = {}, onError, }) => {
|
|
122
|
-
var _a;
|
|
122
|
+
var _a, _b;
|
|
123
123
|
if (error instanceof MfaInvalidOtpError ||
|
|
124
124
|
error instanceof MfaRateLimitedError) {
|
|
125
125
|
throw error;
|
|
@@ -156,6 +156,16 @@ const useUserAuth = ({ authMethod, }) => {
|
|
|
156
156
|
});
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
|
+
// Re-throw passkey errors so they propagate to usePromise in the UI
|
|
160
|
+
// This allows error messages to be displayed in ConfirmPasskeyView
|
|
161
|
+
// WebAuthnError is the specific error type thrown by @simplewebauthn/browser
|
|
162
|
+
// for passkey operations (authentication/registration failures)
|
|
163
|
+
// NotAllowedError is the underlying DOMException when user cancels or times out
|
|
164
|
+
if ((error === null || error === void 0 ? void 0 : error.name) === 'NotAllowedError' &&
|
|
165
|
+
(((_b = error === null || error === void 0 ? void 0 : error.constructor) === null || _b === void 0 ? void 0 : _b.name) === 'WebAuthnError' ||
|
|
166
|
+
(error === null || error === void 0 ? void 0 : error.code) === 'ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY')) {
|
|
167
|
+
throw error;
|
|
168
|
+
}
|
|
159
169
|
if (onError) {
|
|
160
170
|
onError === null || onError === void 0 ? void 0 : onError(error);
|
|
161
171
|
return;
|