@dynamic-labs/sdk-react-core 4.101.0 → 4.103.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/CHANGELOG.md +15 -0
- package/package.cjs +3 -3
- package/package.js +3 -3
- package/package.json +14 -14
- package/src/lib/components/TransactionCard/SendBalanceTransactionCard.cjs +8 -8
- package/src/lib/components/TransactionCard/SendBalanceTransactionCard.d.ts +3 -1
- package/src/lib/components/TransactionCard/SendBalanceTransactionCard.js +8 -8
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +1 -1
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +1 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/hooks/useStepUpAuthentication/useStepUpAuthentication.types.d.ts +1 -0
- package/src/lib/utils/hooks/useStepUpAuthentication/useStepUpOtp.cjs +24 -17
- package/src/lib/utils/hooks/useStepUpAuthentication/useStepUpOtp.js +24 -17
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.cjs +3 -1
- package/src/lib/utils/hooks/useSyncDynamicWaas/useSyncDynamicWaas.js +3 -1
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.cjs +2 -2
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.d.ts +4 -1
- package/src/lib/views/BackupUnsuccessfulView/BackupUnsuccessfulView.js +2 -2
- package/src/lib/views/StepUpReauthOtpView/StepUpReauthOtpView.cjs +3 -3
- package/src/lib/views/StepUpReauthOtpView/StepUpReauthOtpView.js +3 -3
- package/src/lib/views/viewToComponentMap.d.ts +3 -1
|
@@ -42,11 +42,14 @@ const resolveTargetCredential = (credentials, credentialId) => {
|
|
|
42
42
|
}
|
|
43
43
|
return ((_b = credentials.find((cred) => cred.signInEnabled && isOtpCapableCredential(cred))) !== null && _b !== void 0 ? _b : 'No sign-in enabled email or SMS credential found for step-up authentication');
|
|
44
44
|
};
|
|
45
|
-
const sendEmailOtp = (credential) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
+
const sendEmailOtp = (credential, purpose) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
46
46
|
if (!credential.email) {
|
|
47
47
|
throw new Error('Email credential is missing email address');
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
// `purpose` lets the API tailor the verification email to the step-up
|
|
50
|
+
// operation; client versions predating the param ignore it.
|
|
51
|
+
const params = Object.assign({ email: credential.email }, (purpose !== undefined && { purpose }));
|
|
52
|
+
return client.sendEmailOTP(params);
|
|
50
53
|
});
|
|
51
54
|
const sendSmsOtp = (credential) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
52
55
|
var _a;
|
|
@@ -60,21 +63,22 @@ const sendSmsOtp = (credential) => _tslib.__awaiter(void 0, void 0, void 0, func
|
|
|
60
63
|
}
|
|
61
64
|
return client.sendSmsOTP({ isoCountryCode, phoneNumber: credential.phoneNumber });
|
|
62
65
|
});
|
|
63
|
-
const dispatchOtp = (credential) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
66
|
+
const dispatchOtp = (credential, purpose) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
64
67
|
return credential.format === sdkApiCore.JwtVerifiedCredentialFormatEnum.Email
|
|
65
|
-
? sendEmailOtp(credential)
|
|
68
|
+
? sendEmailOtp(credential, purpose)
|
|
66
69
|
: sendSmsOtp(credential);
|
|
67
70
|
});
|
|
68
71
|
const useStepUpOtp = ({ credentialId, stateActions, }) => {
|
|
69
72
|
const user = useUser.useUser();
|
|
70
73
|
const { setError, setLoading, setState, setSuccess } = stateActions;
|
|
71
74
|
const otpVerificationRef = React.useRef(null);
|
|
72
|
-
// Holds the credential whose OTP send is blocked awaiting
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
+
// Holds the credential and send purpose whose OTP send is blocked awaiting
|
|
76
|
+
// a captcha token.
|
|
77
|
+
const pendingCaptchaSendRef = React.useRef(null);
|
|
78
|
+
const dispatchAndStoreOtp = React.useCallback((credential, purpose) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
75
79
|
setLoading();
|
|
76
80
|
try {
|
|
77
|
-
const otpVerification = yield dispatchOtp(credential);
|
|
81
|
+
const otpVerification = yield dispatchOtp(credential, purpose);
|
|
78
82
|
otpVerificationRef.current = otpVerification;
|
|
79
83
|
setSuccess({ otpVerification });
|
|
80
84
|
return otpVerification;
|
|
@@ -86,7 +90,7 @@ const useStepUpOtp = ({ credentialId, stateActions, }) => {
|
|
|
86
90
|
}
|
|
87
91
|
}), [setError, setLoading, setSuccess]);
|
|
88
92
|
const sendOtp = React.useCallback((params) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
89
|
-
var _a;
|
|
93
|
+
var _a, _b;
|
|
90
94
|
const credentials = user === null || user === void 0 ? void 0 : user.verifiedCredentials;
|
|
91
95
|
if (!(credentials === null || credentials === void 0 ? void 0 : credentials.length)) {
|
|
92
96
|
setError('No verified credentials found for the authenticated user');
|
|
@@ -98,6 +102,9 @@ const useStepUpOtp = ({ credentialId, stateActions, }) => {
|
|
|
98
102
|
setError(result);
|
|
99
103
|
return null;
|
|
100
104
|
}
|
|
105
|
+
// The first requested scope names the operation (e.g. wallet:export),
|
|
106
|
+
// so the OTP email can describe it instead of a sign-in.
|
|
107
|
+
const purpose = (_b = params === null || params === void 0 ? void 0 : params.requestedScopes) === null || _b === void 0 ? void 0 : _b[0];
|
|
101
108
|
if (!isOtpCapableCredential(result)) {
|
|
102
109
|
setError(`Credential format "${result.format}" does not support OTP verification. Only email and SMS credentials are supported`);
|
|
103
110
|
return null;
|
|
@@ -106,11 +113,11 @@ const useStepUpOtp = ({ credentialId, stateActions, }) => {
|
|
|
106
113
|
// captcha-enabled environments. Defer the send and surface the challenge
|
|
107
114
|
// to the UI, which collects a token and completes it via submitCaptchaToken.
|
|
108
115
|
if (client.isCaptchaRequired()) {
|
|
109
|
-
|
|
116
|
+
pendingCaptchaSendRef.current = { credential: result, purpose };
|
|
110
117
|
setState((prev) => (Object.assign(Object.assign({}, prev), { captchaRequired: true, error: null })));
|
|
111
118
|
return null;
|
|
112
119
|
}
|
|
113
|
-
return dispatchAndStoreOtp(result);
|
|
120
|
+
return dispatchAndStoreOtp(result, purpose);
|
|
114
121
|
}), [
|
|
115
122
|
credentialId,
|
|
116
123
|
dispatchAndStoreOtp,
|
|
@@ -119,16 +126,16 @@ const useStepUpOtp = ({ credentialId, stateActions, }) => {
|
|
|
119
126
|
user === null || user === void 0 ? void 0 : user.verifiedCredentials,
|
|
120
127
|
]);
|
|
121
128
|
const submitCaptchaToken = React.useCallback((captchaToken) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
122
|
-
const
|
|
123
|
-
if (!
|
|
129
|
+
const pending = pendingCaptchaSendRef.current;
|
|
130
|
+
if (!pending) {
|
|
124
131
|
return null;
|
|
125
132
|
}
|
|
126
|
-
|
|
133
|
+
pendingCaptchaSendRef.current = null;
|
|
127
134
|
client.setCaptchaToken({ captchaToken });
|
|
128
135
|
setState((prev) => (Object.assign(Object.assign({}, prev), { captchaRequired: false })));
|
|
129
|
-
return dispatchAndStoreOtp(credential);
|
|
136
|
+
return dispatchAndStoreOtp(pending.credential, pending.purpose);
|
|
130
137
|
}), [dispatchAndStoreOtp, setState]);
|
|
131
|
-
const verifyOtp = React.useCallback((
|
|
138
|
+
const verifyOtp = React.useCallback((_c) => _tslib.__awaiter(void 0, [_c], void 0, function* ({ requestedScopes, verificationToken, }) {
|
|
132
139
|
const otpVerification = otpVerificationRef.current;
|
|
133
140
|
if (!otpVerification) {
|
|
134
141
|
setError('OTP verification has not been initiated. Call sendOtp() first');
|
|
@@ -152,7 +159,7 @@ const useStepUpOtp = ({ credentialId, stateActions, }) => {
|
|
|
152
159
|
}), [setError, setLoading, setSuccess]);
|
|
153
160
|
const resetOtpRef = React.useCallback(() => {
|
|
154
161
|
otpVerificationRef.current = null;
|
|
155
|
-
|
|
162
|
+
pendingCaptchaSendRef.current = null;
|
|
156
163
|
}, []);
|
|
157
164
|
return { resetOtpRef, sendOtp, submitCaptchaToken, verifyOtp };
|
|
158
165
|
};
|
|
@@ -38,11 +38,14 @@ const resolveTargetCredential = (credentials, credentialId) => {
|
|
|
38
38
|
}
|
|
39
39
|
return ((_b = credentials.find((cred) => cred.signInEnabled && isOtpCapableCredential(cred))) !== null && _b !== void 0 ? _b : 'No sign-in enabled email or SMS credential found for step-up authentication');
|
|
40
40
|
};
|
|
41
|
-
const sendEmailOtp = (credential) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
const sendEmailOtp = (credential, purpose) => __awaiter(void 0, void 0, void 0, function* () {
|
|
42
42
|
if (!credential.email) {
|
|
43
43
|
throw new Error('Email credential is missing email address');
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
// `purpose` lets the API tailor the verification email to the step-up
|
|
46
|
+
// operation; client versions predating the param ignore it.
|
|
47
|
+
const params = Object.assign({ email: credential.email }, (purpose !== undefined && { purpose }));
|
|
48
|
+
return sendEmailOTP(params);
|
|
46
49
|
});
|
|
47
50
|
const sendSmsOtp = (credential) => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
51
|
var _a;
|
|
@@ -56,21 +59,22 @@ const sendSmsOtp = (credential) => __awaiter(void 0, void 0, void 0, function* (
|
|
|
56
59
|
}
|
|
57
60
|
return sendSmsOTP({ isoCountryCode, phoneNumber: credential.phoneNumber });
|
|
58
61
|
});
|
|
59
|
-
const dispatchOtp = (credential) => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
|
+
const dispatchOtp = (credential, purpose) => __awaiter(void 0, void 0, void 0, function* () {
|
|
60
63
|
return credential.format === JwtVerifiedCredentialFormatEnum.Email
|
|
61
|
-
? sendEmailOtp(credential)
|
|
64
|
+
? sendEmailOtp(credential, purpose)
|
|
62
65
|
: sendSmsOtp(credential);
|
|
63
66
|
});
|
|
64
67
|
const useStepUpOtp = ({ credentialId, stateActions, }) => {
|
|
65
68
|
const user = useUser();
|
|
66
69
|
const { setError, setLoading, setState, setSuccess } = stateActions;
|
|
67
70
|
const otpVerificationRef = useRef(null);
|
|
68
|
-
// Holds the credential whose OTP send is blocked awaiting
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
+
// Holds the credential and send purpose whose OTP send is blocked awaiting
|
|
72
|
+
// a captcha token.
|
|
73
|
+
const pendingCaptchaSendRef = useRef(null);
|
|
74
|
+
const dispatchAndStoreOtp = useCallback((credential, purpose) => __awaiter(void 0, void 0, void 0, function* () {
|
|
71
75
|
setLoading();
|
|
72
76
|
try {
|
|
73
|
-
const otpVerification = yield dispatchOtp(credential);
|
|
77
|
+
const otpVerification = yield dispatchOtp(credential, purpose);
|
|
74
78
|
otpVerificationRef.current = otpVerification;
|
|
75
79
|
setSuccess({ otpVerification });
|
|
76
80
|
return otpVerification;
|
|
@@ -82,7 +86,7 @@ const useStepUpOtp = ({ credentialId, stateActions, }) => {
|
|
|
82
86
|
}
|
|
83
87
|
}), [setError, setLoading, setSuccess]);
|
|
84
88
|
const sendOtp = useCallback((params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
85
|
-
var _a;
|
|
89
|
+
var _a, _b;
|
|
86
90
|
const credentials = user === null || user === void 0 ? void 0 : user.verifiedCredentials;
|
|
87
91
|
if (!(credentials === null || credentials === void 0 ? void 0 : credentials.length)) {
|
|
88
92
|
setError('No verified credentials found for the authenticated user');
|
|
@@ -94,6 +98,9 @@ const useStepUpOtp = ({ credentialId, stateActions, }) => {
|
|
|
94
98
|
setError(result);
|
|
95
99
|
return null;
|
|
96
100
|
}
|
|
101
|
+
// The first requested scope names the operation (e.g. wallet:export),
|
|
102
|
+
// so the OTP email can describe it instead of a sign-in.
|
|
103
|
+
const purpose = (_b = params === null || params === void 0 ? void 0 : params.requestedScopes) === null || _b === void 0 ? void 0 : _b[0];
|
|
97
104
|
if (!isOtpCapableCredential(result)) {
|
|
98
105
|
setError(`Credential format "${result.format}" does not support OTP verification. Only email and SMS credentials are supported`);
|
|
99
106
|
return null;
|
|
@@ -102,11 +109,11 @@ const useStepUpOtp = ({ credentialId, stateActions, }) => {
|
|
|
102
109
|
// captcha-enabled environments. Defer the send and surface the challenge
|
|
103
110
|
// to the UI, which collects a token and completes it via submitCaptchaToken.
|
|
104
111
|
if (isCaptchaRequired()) {
|
|
105
|
-
|
|
112
|
+
pendingCaptchaSendRef.current = { credential: result, purpose };
|
|
106
113
|
setState((prev) => (Object.assign(Object.assign({}, prev), { captchaRequired: true, error: null })));
|
|
107
114
|
return null;
|
|
108
115
|
}
|
|
109
|
-
return dispatchAndStoreOtp(result);
|
|
116
|
+
return dispatchAndStoreOtp(result, purpose);
|
|
110
117
|
}), [
|
|
111
118
|
credentialId,
|
|
112
119
|
dispatchAndStoreOtp,
|
|
@@ -115,16 +122,16 @@ const useStepUpOtp = ({ credentialId, stateActions, }) => {
|
|
|
115
122
|
user === null || user === void 0 ? void 0 : user.verifiedCredentials,
|
|
116
123
|
]);
|
|
117
124
|
const submitCaptchaToken = useCallback((captchaToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
118
|
-
const
|
|
119
|
-
if (!
|
|
125
|
+
const pending = pendingCaptchaSendRef.current;
|
|
126
|
+
if (!pending) {
|
|
120
127
|
return null;
|
|
121
128
|
}
|
|
122
|
-
|
|
129
|
+
pendingCaptchaSendRef.current = null;
|
|
123
130
|
setCaptchaToken({ captchaToken });
|
|
124
131
|
setState((prev) => (Object.assign(Object.assign({}, prev), { captchaRequired: false })));
|
|
125
|
-
return dispatchAndStoreOtp(credential);
|
|
132
|
+
return dispatchAndStoreOtp(pending.credential, pending.purpose);
|
|
126
133
|
}), [dispatchAndStoreOtp, setState]);
|
|
127
|
-
const verifyOtp = useCallback((
|
|
134
|
+
const verifyOtp = useCallback((_c) => __awaiter(void 0, [_c], void 0, function* ({ requestedScopes, verificationToken, }) {
|
|
128
135
|
const otpVerification = otpVerificationRef.current;
|
|
129
136
|
if (!otpVerification) {
|
|
130
137
|
setError('OTP verification has not been initiated. Call sendOtp() first');
|
|
@@ -148,7 +155,7 @@ const useStepUpOtp = ({ credentialId, stateActions, }) => {
|
|
|
148
155
|
}), [setError, setLoading, setSuccess]);
|
|
149
156
|
const resetOtpRef = useCallback(() => {
|
|
150
157
|
otpVerificationRef.current = null;
|
|
151
|
-
|
|
158
|
+
pendingCaptchaSendRef.current = null;
|
|
152
159
|
}, []);
|
|
153
160
|
return { resetOtpRef, sendOtp, submitCaptchaToken, verifyOtp };
|
|
154
161
|
};
|
|
@@ -123,7 +123,9 @@ const useWalletCreation = () => {
|
|
|
123
123
|
}
|
|
124
124
|
logger.logger.error('Error creating dynamic waas wallet', error);
|
|
125
125
|
setShowAuthFlow(true, { ignoreIfIsEmbeddedWidget: false });
|
|
126
|
-
clearStackAndPush('backup-unsuccessful'
|
|
126
|
+
clearStackAndPush('backup-unsuccessful', {
|
|
127
|
+
errorMessage: error.message,
|
|
128
|
+
});
|
|
127
129
|
},
|
|
128
130
|
});
|
|
129
131
|
};
|
|
@@ -119,7 +119,9 @@ const useWalletCreation = () => {
|
|
|
119
119
|
}
|
|
120
120
|
logger.error('Error creating dynamic waas wallet', error);
|
|
121
121
|
setShowAuthFlow(true, { ignoreIfIsEmbeddedWidget: false });
|
|
122
|
-
clearStackAndPush('backup-unsuccessful'
|
|
122
|
+
clearStackAndPush('backup-unsuccessful', {
|
|
123
|
+
errorMessage: error.message,
|
|
124
|
+
});
|
|
123
125
|
},
|
|
124
126
|
});
|
|
125
127
|
};
|
|
@@ -124,7 +124,7 @@ require('../../components/IsBrowser/IsBrowser.cjs');
|
|
|
124
124
|
require('../../components/Popper/Popper/Popper.cjs');
|
|
125
125
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
126
126
|
|
|
127
|
-
const BackupUnsuccessfulView = () => {
|
|
127
|
+
const BackupUnsuccessfulView = ({ errorMessage, }) => {
|
|
128
128
|
var _a, _b;
|
|
129
129
|
const { t } = reactI18next.useTranslation();
|
|
130
130
|
const projectSettings = useProjectSettings.useProjectSettings();
|
|
@@ -167,7 +167,7 @@ const BackupUnsuccessfulView = () => {
|
|
|
167
167
|
position: 'absolute',
|
|
168
168
|
top: '50%',
|
|
169
169
|
transform: 'translate(-50%, -50%)',
|
|
170
|
-
} })] })] }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', className: 'backup-message', color: 'primary', copykey: 'dyn_waas.backup_unsuccessful.description', children: t('dyn_waas.backup_unsuccessful.description') }), jsxRuntime.jsx("div", { className: classNames.classNames('button-group', {
|
|
170
|
+
} })] })] }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', className: 'backup-message', color: 'primary', copykey: 'dyn_waas.backup_unsuccessful.description', children: t('dyn_waas.backup_unsuccessful.description') }), errorMessage && (jsxRuntime.jsx(Typography.Typography, { variant: 'body_mini', color: 'error-1', className: 'backup-error-message', children: errorMessage })), jsxRuntime.jsx("div", { className: classNames.classNames('button-group', {
|
|
171
171
|
'button-group--with-help-section': hasContactInfo,
|
|
172
172
|
}), children: jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'retry-button', buttonVariant: 'brand-primary', type: 'submit', onClick: onTryAgainClick, copykey: 'dyn_waas.backup_unsuccessful.try_again', typographyProps: {
|
|
173
173
|
color: 'inherit',
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
type BackupUnsuccessfulViewProps = {
|
|
3
|
+
errorMessage?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const BackupUnsuccessfulView: React.FC<BackupUnsuccessfulViewProps>;
|
|
3
6
|
export default BackupUnsuccessfulView;
|
|
@@ -120,7 +120,7 @@ import '../../components/IsBrowser/IsBrowser.js';
|
|
|
120
120
|
import '../../components/Popper/Popper/Popper.js';
|
|
121
121
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
122
122
|
|
|
123
|
-
const BackupUnsuccessfulView = () => {
|
|
123
|
+
const BackupUnsuccessfulView = ({ errorMessage, }) => {
|
|
124
124
|
var _a, _b;
|
|
125
125
|
const { t } = useTranslation();
|
|
126
126
|
const projectSettings = useProjectSettings();
|
|
@@ -163,7 +163,7 @@ const BackupUnsuccessfulView = () => {
|
|
|
163
163
|
position: 'absolute',
|
|
164
164
|
top: '50%',
|
|
165
165
|
transform: 'translate(-50%, -50%)',
|
|
166
|
-
} })] })] }), jsx(Typography, { variant: 'body_normal', className: 'backup-message', color: 'primary', copykey: 'dyn_waas.backup_unsuccessful.description', children: t('dyn_waas.backup_unsuccessful.description') }), jsx("div", { className: classNames('button-group', {
|
|
166
|
+
} })] })] }), jsx(Typography, { variant: 'body_normal', className: 'backup-message', color: 'primary', copykey: 'dyn_waas.backup_unsuccessful.description', children: t('dyn_waas.backup_unsuccessful.description') }), errorMessage && (jsx(Typography, { variant: 'body_mini', color: 'error-1', className: 'backup-error-message', children: errorMessage })), jsx("div", { className: classNames('button-group', {
|
|
167
167
|
'button-group--with-help-section': hasContactInfo,
|
|
168
168
|
}), children: jsx(TypographyButton, { buttonClassName: 'retry-button', buttonVariant: 'brand-primary', type: 'submit', onClick: onTryAgainClick, copykey: 'dyn_waas.backup_unsuccessful.try_again', typographyProps: {
|
|
169
169
|
color: 'inherit',
|
|
@@ -24,8 +24,8 @@ const StepUpReauthOtpView = ({ credentialId, displayLabel, requestedScopes, type
|
|
|
24
24
|
if (hasSentInitialOtpRef.current)
|
|
25
25
|
return;
|
|
26
26
|
hasSentInitialOtpRef.current = true;
|
|
27
|
-
sendOtp();
|
|
28
|
-
}, [sendOtp]);
|
|
27
|
+
sendOtp({ requestedScopes });
|
|
28
|
+
}, [requestedScopes, sendOtp]);
|
|
29
29
|
const handlePinComplete = (verificationToken) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
30
30
|
const response = yield verifyOtp({
|
|
31
31
|
requestedScopes,
|
|
@@ -46,7 +46,7 @@ const StepUpReauthOtpView = ({ credentialId, displayLabel, requestedScopes, type
|
|
|
46
46
|
return jsxRuntime.jsx(CaptchaChallenge.CaptchaChallenge, { onSuccess: submitCaptchaToken });
|
|
47
47
|
}
|
|
48
48
|
return (jsxRuntime.jsx(OTPVerificationView.OTPVerificationView, { MainIcon: MainIcon, displayedDestination: displayLabel, error: displayError, isLoading: isLoading, isValid: verificationSuccess, onPinComplete: handlePinComplete, retryHandler: () => {
|
|
49
|
-
void sendOtp();
|
|
49
|
+
void sendOtp({ requestedScopes });
|
|
50
50
|
}, successBannerTextKey: 'dyn_otp_verification.verification_succeeded' }));
|
|
51
51
|
};
|
|
52
52
|
|
|
@@ -20,8 +20,8 @@ const StepUpReauthOtpView = ({ credentialId, displayLabel, requestedScopes, type
|
|
|
20
20
|
if (hasSentInitialOtpRef.current)
|
|
21
21
|
return;
|
|
22
22
|
hasSentInitialOtpRef.current = true;
|
|
23
|
-
sendOtp();
|
|
24
|
-
}, [sendOtp]);
|
|
23
|
+
sendOtp({ requestedScopes });
|
|
24
|
+
}, [requestedScopes, sendOtp]);
|
|
25
25
|
const handlePinComplete = (verificationToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
26
|
const response = yield verifyOtp({
|
|
27
27
|
requestedScopes,
|
|
@@ -42,7 +42,7 @@ const StepUpReauthOtpView = ({ credentialId, displayLabel, requestedScopes, type
|
|
|
42
42
|
return jsx(CaptchaChallenge, { onSuccess: submitCaptchaToken });
|
|
43
43
|
}
|
|
44
44
|
return (jsx(OTPVerificationView, { MainIcon: MainIcon, displayedDestination: displayLabel, error: displayError, isLoading: isLoading, isValid: verificationSuccess, onPinComplete: handlePinComplete, retryHandler: () => {
|
|
45
|
-
void sendOtp();
|
|
45
|
+
void sendOtp({ requestedScopes });
|
|
46
46
|
}, successBannerTextKey: 'dyn_otp_verification.verification_succeeded' }));
|
|
47
47
|
};
|
|
48
48
|
|
|
@@ -4,7 +4,9 @@ export declare const viewToComponentMap: {
|
|
|
4
4
|
'account-exists': () => JSX.Element;
|
|
5
5
|
'account-upgraded': import("react").FC;
|
|
6
6
|
'auth-loading': import("react").FC;
|
|
7
|
-
'backup-unsuccessful': import("react").FC<{
|
|
7
|
+
'backup-unsuccessful': import("react").FC<{
|
|
8
|
+
errorMessage?: string | undefined;
|
|
9
|
+
}>;
|
|
8
10
|
'bridge-next-wallet-connection': import("react").FC;
|
|
9
11
|
'bridge-summary': () => JSX.Element;
|
|
10
12
|
'bridge-welcome': () => JSX.Element;
|