@web3auth/modal 10.9.1 → 10.11.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/dist/lib.cjs/packages/modal/src/config.js +1 -1
- package/dist/lib.cjs/packages/modal/src/modalManager.js +27 -9
- package/dist/lib.cjs/packages/modal/src/react/context/WalletServicesInnerContext.js +4 -4
- package/dist/lib.cjs/packages/modal/src/react/context/Web3AuthInnerContext.js +25 -10
- package/dist/lib.cjs/packages/modal/src/react/hooks/useIdentityToken.js +7 -3
- package/dist/lib.cjs/packages/modal/src/react/hooks/useWeb3Auth.js +2 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +5 -3
- package/dist/lib.cjs/packages/modal/src/ui/components/CircularLoader/CircularLoader.js +88 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +2 -2
- package/dist/lib.cjs/packages/modal/src/ui/components/Loader/Loader.js +67 -5
- package/dist/lib.cjs/packages/modal/src/ui/components/Root/Root.js +8 -2
- package/dist/lib.cjs/packages/modal/src/ui/components/Widget/Widget.js +18 -5
- package/dist/lib.cjs/packages/modal/src/ui/css/index.css.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/i18n/english.json.js +3 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/french.json.js +3 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/german.json.js +3 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/japanese.json.js +3 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/korean.json.js +3 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/mandarin.json.js +3 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/portuguese.json.js +3 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/spanish.json.js +3 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/turkish.json.js +3 -0
- package/dist/lib.cjs/packages/modal/src/ui/interfaces.js +3 -1
- package/dist/lib.cjs/packages/modal/src/ui/loginModal.js +26 -2
- package/dist/lib.cjs/packages/modal/src/vue/WalletServicesInnerProvider.js +4 -4
- package/dist/lib.cjs/packages/modal/src/vue/Web3AuthProvider.js +21 -11
- package/dist/lib.cjs/packages/modal/src/vue/composables/useCheckout.js +1 -0
- package/dist/lib.cjs/packages/modal/src/vue/composables/useEnableMFA.js +1 -0
- package/dist/lib.cjs/packages/modal/src/vue/composables/useFunding.js +1 -0
- package/dist/lib.cjs/packages/modal/src/vue/composables/useIdentityToken.js +10 -3
- package/dist/lib.cjs/packages/modal/src/vue/composables/useManageMFA.js +1 -0
- package/dist/lib.cjs/packages/modal/src/vue/composables/useReceive.js +1 -0
- package/dist/lib.cjs/packages/modal/src/vue/composables/useSwap.js +1 -0
- package/dist/lib.cjs/packages/modal/src/vue/composables/useSwitchChain.js +1 -0
- package/dist/lib.cjs/packages/modal/src/vue/composables/useWalletConnectScanner.js +1 -0
- package/dist/lib.cjs/packages/modal/src/vue/composables/useWalletUI.js +1 -0
- package/dist/lib.cjs/packages/modal/src/vue/composables/useWeb3AuthConnect.js +2 -0
- package/dist/lib.cjs/packages/modal/src/vue/composables/useWeb3AuthDisconnect.js +1 -0
- package/dist/lib.cjs/packages/modal/src/vue/composables/useWeb3AuthUser.js +1 -0
- package/dist/lib.cjs/packages/modal/src/vue/solana/composables/useSignAndSendTransaction.js +1 -0
- package/dist/lib.cjs/packages/modal/src/vue/solana/composables/useSignMessage.js +1 -0
- package/dist/lib.cjs/packages/modal/src/vue/solana/composables/useSignTransaction.js +1 -0
- package/dist/lib.cjs/types/modalManager.d.ts +1 -0
- package/dist/lib.cjs/types/ui/components/BottomSheet/BottomSheet.d.ts +1 -1
- package/dist/lib.cjs/types/ui/components/BottomSheet/BottomSheet.type.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/CircularLoader/CircularLoader.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/CircularLoader/CircularLoader.type.d.ts +19 -0
- package/dist/lib.cjs/types/ui/components/CircularLoader/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Loader/Loader.type.d.ts +8 -0
- package/dist/lib.cjs/types/ui/components/Root/Root.type.d.ts +5 -1
- package/dist/lib.cjs/types/ui/components/Widget/Widget.type.d.ts +5 -1
- package/dist/lib.cjs/types/ui/interfaces.d.ts +7 -1
- package/dist/lib.cjs/types/ui/loginModal.d.ts +1 -0
- package/dist/lib.cjs/types/vue/interfaces.d.ts +1 -0
- package/dist/lib.esm/packages/modal/src/config.js +1 -1
- package/dist/lib.esm/packages/modal/src/modalManager.js +28 -10
- package/dist/lib.esm/packages/modal/src/react/context/WalletServicesInnerContext.js +5 -5
- package/dist/lib.esm/packages/modal/src/react/context/Web3AuthInnerContext.js +25 -10
- package/dist/lib.esm/packages/modal/src/react/hooks/useIdentityToken.js +7 -3
- package/dist/lib.esm/packages/modal/src/react/hooks/useWeb3Auth.js +2 -0
- package/dist/lib.esm/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +5 -3
- package/dist/lib.esm/packages/modal/src/ui/components/CircularLoader/CircularLoader.js +86 -0
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +2 -2
- package/dist/lib.esm/packages/modal/src/ui/components/Loader/Loader.js +68 -6
- package/dist/lib.esm/packages/modal/src/ui/components/Root/Root.js +8 -2
- package/dist/lib.esm/packages/modal/src/ui/components/Widget/Widget.js +19 -6
- package/dist/lib.esm/packages/modal/src/ui/css/index.css.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/i18n/english.json.js +3 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/french.json.js +3 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/german.json.js +3 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/japanese.json.js +3 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/korean.json.js +3 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/mandarin.json.js +3 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/portuguese.json.js +3 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/spanish.json.js +3 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/turkish.json.js +3 -0
- package/dist/lib.esm/packages/modal/src/ui/interfaces.js +3 -1
- package/dist/lib.esm/packages/modal/src/ui/loginModal.js +28 -4
- package/dist/lib.esm/packages/modal/src/vue/WalletServicesInnerProvider.js +4 -4
- package/dist/lib.esm/packages/modal/src/vue/Web3AuthProvider.js +22 -12
- package/dist/lib.esm/packages/modal/src/vue/composables/useCheckout.js +2 -1
- package/dist/lib.esm/packages/modal/src/vue/composables/useEnableMFA.js +2 -1
- package/dist/lib.esm/packages/modal/src/vue/composables/useFunding.js +2 -1
- package/dist/lib.esm/packages/modal/src/vue/composables/useIdentityToken.js +11 -4
- package/dist/lib.esm/packages/modal/src/vue/composables/useManageMFA.js +2 -1
- package/dist/lib.esm/packages/modal/src/vue/composables/useReceive.js +2 -1
- package/dist/lib.esm/packages/modal/src/vue/composables/useSwap.js +2 -1
- package/dist/lib.esm/packages/modal/src/vue/composables/useSwitchChain.js +2 -1
- package/dist/lib.esm/packages/modal/src/vue/composables/useWalletConnectScanner.js +2 -1
- package/dist/lib.esm/packages/modal/src/vue/composables/useWalletUI.js +2 -1
- package/dist/lib.esm/packages/modal/src/vue/composables/useWeb3AuthConnect.js +3 -1
- package/dist/lib.esm/packages/modal/src/vue/composables/useWeb3AuthDisconnect.js +2 -1
- package/dist/lib.esm/packages/modal/src/vue/composables/useWeb3AuthUser.js +2 -1
- package/dist/lib.esm/packages/modal/src/vue/solana/composables/useSignAndSendTransaction.js +2 -1
- package/dist/lib.esm/packages/modal/src/vue/solana/composables/useSignMessage.js +2 -1
- package/dist/lib.esm/packages/modal/src/vue/solana/composables/useSignTransaction.js +2 -1
- package/dist/modal.umd.min.js +1 -1
- package/package.json +3 -3
|
@@ -70,12 +70,20 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
70
70
|
noModal.log.error(`Error while disconnecting to wallet connect in core`, error);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
if (!visibility && this.status
|
|
73
|
+
if (!visibility && noModal.CONNECTED_STATUSES.includes(this.status) && (walletConnectStatus === noModal.CONNECTOR_STATUS.READY || walletConnectStatus === noModal.CONNECTOR_STATUS.CONNECTING)) {
|
|
74
74
|
noModal.log.debug("this stops wc connector from trying to reconnect once proposal expires");
|
|
75
75
|
wcConnector.status = noModal.CONNECTOR_STATUS.READY;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
|
+
_defineProperty(this, "onMobileVerifyConnect", async params => {
|
|
80
|
+
try {
|
|
81
|
+
const connector = this.getConnector(params.connector);
|
|
82
|
+
await connector.getIdentityToken();
|
|
83
|
+
} catch (error) {
|
|
84
|
+
noModal.log.error(`Error while connecting to connector: ${params.connector}`, error);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
79
87
|
_defineProperty(this, "getChainNamespaces", () => {
|
|
80
88
|
var _this$coreOptions$cha;
|
|
81
89
|
return [...new Set(((_this$coreOptions$cha = this.coreOptions.chains) === null || _this$coreOptions$cha === void 0 ? void 0 : _this$coreOptions$cha.map(x => x.chainNamespace)) || [])];
|
|
@@ -136,12 +144,14 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
136
144
|
authBuildEnv: this.options.authBuildEnv,
|
|
137
145
|
chainNamespaces: this.getChainNamespaces(),
|
|
138
146
|
walletRegistry: filteredWalletRegistry,
|
|
139
|
-
analytics: this.analytics
|
|
147
|
+
analytics: this.analytics,
|
|
148
|
+
initialAuthenticationMode: this.options.initialAuthenticationMode
|
|
140
149
|
}), {
|
|
141
150
|
onInitExternalWallets: this.onInitExternalWallets,
|
|
142
151
|
onSocialLogin: this.onSocialLogin,
|
|
143
152
|
onExternalWalletLogin: this.onExternalWalletLogin,
|
|
144
|
-
onModalVisibility: this.onModalVisibility
|
|
153
|
+
onModalVisibility: this.onModalVisibility,
|
|
154
|
+
onMobileVerifyConnect: this.onMobileVerifyConnect
|
|
145
155
|
});
|
|
146
156
|
await noModal.withAbort(() => this.loginModal.initModal(), signal);
|
|
147
157
|
// setup common JRPC provider
|
|
@@ -192,7 +202,7 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
192
202
|
async connect() {
|
|
193
203
|
if (!this.loginModal) throw noModal.WalletInitializationError.notReady("Login modal is not initialized");
|
|
194
204
|
// if already connected return provider
|
|
195
|
-
if (this.connectedConnectorName && this.status
|
|
205
|
+
if (this.connectedConnectorName && noModal.CONNECTED_STATUSES.includes(this.status) && this.provider) return this.provider;
|
|
196
206
|
this.loginModal.open();
|
|
197
207
|
return new Promise((resolve, reject) => {
|
|
198
208
|
// remove all listeners when promise is resolved or rejected.
|
|
@@ -204,18 +214,24 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
204
214
|
};
|
|
205
215
|
const handleError = err => {
|
|
206
216
|
this.removeListener(noModal.CONNECTOR_EVENTS.CONNECTED, handleConnected);
|
|
217
|
+
this.removeListener(noModal.CONNECTOR_EVENTS.AUTHORIZED, handleConnected);
|
|
207
218
|
this.removeListener(interfaces.LOGIN_MODAL_EVENTS.MODAL_VISIBILITY, handleVisibility);
|
|
208
219
|
return reject(err);
|
|
209
220
|
};
|
|
210
221
|
const handleVisibility = visibility => {
|
|
211
222
|
// modal is closed but user is not connected to any wallet.
|
|
212
|
-
if (!visibility && this.status
|
|
223
|
+
if (!visibility && !noModal.CONNECTED_STATUSES.includes(this.status)) {
|
|
213
224
|
this.removeListener(noModal.CONNECTOR_EVENTS.CONNECTED, handleConnected);
|
|
214
225
|
this.removeListener(noModal.CONNECTOR_EVENTS.ERRORED, handleError);
|
|
226
|
+
this.removeListener(noModal.CONNECTOR_EVENTS.AUTHORIZED, handleConnected);
|
|
215
227
|
return reject(new Error("User closed the modal"));
|
|
216
228
|
}
|
|
217
229
|
};
|
|
218
|
-
this.
|
|
230
|
+
if (this.coreOptions.initialAuthenticationMode === noModal.CONNECTOR_INITIAL_AUTHENTICATION_MODE.CONNECT_AND_SIGN) {
|
|
231
|
+
this.once(noModal.CONNECTOR_EVENTS.AUTHORIZED, handleConnected);
|
|
232
|
+
} else {
|
|
233
|
+
this.once(noModal.CONNECTOR_EVENTS.CONNECTED, handleConnected);
|
|
234
|
+
}
|
|
219
235
|
this.once(noModal.CONNECTOR_EVENTS.ERRORED, handleError);
|
|
220
236
|
this.once(interfaces.LOGIN_MODAL_EVENTS.MODAL_VISIBILITY, handleVisibility);
|
|
221
237
|
});
|
|
@@ -508,7 +524,8 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
508
524
|
const autoConnect = super.checkIfAutoConnect(connector);
|
|
509
525
|
await connector.init({
|
|
510
526
|
autoConnect,
|
|
511
|
-
chainId: initialChain.chainId
|
|
527
|
+
chainId: initialChain.chainId,
|
|
528
|
+
getIdentityToken: this.options.initialAuthenticationMode === noModal.CONNECTOR_INITIAL_AUTHENTICATION_MODE.CONNECT_AND_SIGN
|
|
512
529
|
});
|
|
513
530
|
// note: not adding cachedWallet to modal if it is external wallet.
|
|
514
531
|
// adding it later if no in-app wallets are available.
|
|
@@ -548,14 +565,15 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
548
565
|
const initialChain = this.getInitialChainIdForConnector(connector);
|
|
549
566
|
await connector.init({
|
|
550
567
|
autoConnect: this.cachedConnector === connectorName,
|
|
551
|
-
chainId: initialChain.chainId
|
|
568
|
+
chainId: initialChain.chainId,
|
|
569
|
+
getIdentityToken: this.options.initialAuthenticationMode === noModal.CONNECTOR_INITIAL_AUTHENTICATION_MODE.CONNECT_AND_SIGN
|
|
552
570
|
});
|
|
553
571
|
} catch (error) {
|
|
554
572
|
noModal.log.error(error, "error while initializing connector", connectorName);
|
|
555
573
|
}
|
|
556
574
|
}
|
|
557
575
|
// update connector config
|
|
558
|
-
if ([noModal.CONNECTOR_STATUS.NOT_READY, noModal.CONNECTOR_STATUS.READY, noModal.CONNECTOR_STATUS.CONNECTING, noModal.CONNECTOR_STATUS.CONNECTED].includes(connector.status)) {
|
|
576
|
+
if ([noModal.CONNECTOR_STATUS.NOT_READY, noModal.CONNECTOR_STATUS.READY, noModal.CONNECTOR_STATUS.CONNECTING, noModal.CONNECTOR_STATUS.CONNECTED, noModal.CONNECTOR_STATUS.AUTHORIZING, noModal.CONNECTOR_STATUS.AUTHORIZED].includes(connector.status)) {
|
|
559
577
|
const connectorModalConfig = this.modalConfig.connectors[connectorName];
|
|
560
578
|
connectorsConfig[connectorName] = _objectSpread(_objectSpread({}, connectorModalConfig), {}, {
|
|
561
579
|
isInjected: connector.isInjected,
|
|
@@ -28,7 +28,7 @@ function WalletServicesContextProvider({
|
|
|
28
28
|
const plugin = getPlugin(noModal.EVM_PLUGINS.WALLET_SERVICES);
|
|
29
29
|
setWalletServicesPlugin(plugin);
|
|
30
30
|
// when rehydrating, the connectedListener may be registered after the connected event is emitted, we need to check the status here
|
|
31
|
-
if ((plugin === null || plugin === void 0 ? void 0 : plugin.status)
|
|
31
|
+
if (noModal.CONNECTED_STATUSES.includes(plugin === null || plugin === void 0 ? void 0 : plugin.status)) setReady(true);
|
|
32
32
|
}
|
|
33
33
|
}, [isConnected, getPlugin, walletServicesPlugin]);
|
|
34
34
|
react.useEffect(() => {
|
|
@@ -50,9 +50,9 @@ function WalletServicesContextProvider({
|
|
|
50
50
|
}
|
|
51
51
|
return () => {
|
|
52
52
|
if (walletServicesPlugin) {
|
|
53
|
-
walletServicesPlugin.
|
|
54
|
-
walletServicesPlugin.
|
|
55
|
-
walletServicesPlugin.
|
|
53
|
+
walletServicesPlugin.removeListener(noModal.PLUGIN_EVENTS.CONNECTED, connectedListener);
|
|
54
|
+
walletServicesPlugin.removeListener(noModal.PLUGIN_EVENTS.DISCONNECTED, disconnectedListener);
|
|
55
|
+
walletServicesPlugin.removeListener(noModal.PLUGIN_EVENTS.CONNECTING, connectingListener);
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
}, [walletServicesPlugin]);
|
|
@@ -26,6 +26,7 @@ function Web3AuthInnerProvider(params) {
|
|
|
26
26
|
return new modalManager.Web3Auth(web3AuthOptions, initialState);
|
|
27
27
|
}, [web3AuthOptions, initialState]);
|
|
28
28
|
const [isConnected, setIsConnected] = react.useState(web3Auth.status === noModal.CONNECTOR_STATUS.CONNECTED);
|
|
29
|
+
const [isAuthorized, setIsAuthorized] = react.useState(web3Auth.status === noModal.CONNECTOR_STATUS.AUTHORIZED);
|
|
29
30
|
const [status, setStatus] = react.useState(web3Auth.status);
|
|
30
31
|
const getPlugin = react.useCallback(name => {
|
|
31
32
|
if (!web3Auth) throw noModal.WalletInitializationError.notReady();
|
|
@@ -66,7 +67,9 @@ function Web3AuthInnerProvider(params) {
|
|
|
66
67
|
if (provider) {
|
|
67
68
|
provider.on("chainChanged", handleChainChange);
|
|
68
69
|
return () => {
|
|
69
|
-
provider
|
|
70
|
+
if (provider) {
|
|
71
|
+
provider.removeListener("chainChanged", handleChainChange);
|
|
72
|
+
}
|
|
70
73
|
};
|
|
71
74
|
}
|
|
72
75
|
}, [web3Auth, provider]);
|
|
@@ -85,9 +88,17 @@ function Web3AuthInnerProvider(params) {
|
|
|
85
88
|
setProvider(data.provider);
|
|
86
89
|
}
|
|
87
90
|
};
|
|
91
|
+
const authorizedListener = _data => {
|
|
92
|
+
setStatus(web3Auth.status);
|
|
93
|
+
if (web3Auth.status === noModal.CONNECTOR_STATUS.AUTHORIZED) {
|
|
94
|
+
setIsConnected(true);
|
|
95
|
+
setIsAuthorized(true);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
88
98
|
const disconnectedListener = () => {
|
|
89
99
|
setStatus(web3Auth.status);
|
|
90
100
|
setIsConnected(false);
|
|
101
|
+
setIsAuthorized(false);
|
|
91
102
|
setProvider(null);
|
|
92
103
|
};
|
|
93
104
|
const connectingListener = () => {
|
|
@@ -99,6 +110,7 @@ function Web3AuthInnerProvider(params) {
|
|
|
99
110
|
const rehydrationErrorListener = () => {
|
|
100
111
|
setStatus(web3Auth.status);
|
|
101
112
|
setIsConnected(false);
|
|
113
|
+
setIsAuthorized(false);
|
|
102
114
|
setProvider(null);
|
|
103
115
|
};
|
|
104
116
|
const mfaEnabledListener = isMFAEnabled => {
|
|
@@ -110,6 +122,7 @@ function Web3AuthInnerProvider(params) {
|
|
|
110
122
|
web3Auth.on(noModal.CONNECTOR_EVENTS.NOT_READY, notReadyListener);
|
|
111
123
|
web3Auth.on(noModal.CONNECTOR_EVENTS.READY, readyListener);
|
|
112
124
|
web3Auth.on(noModal.CONNECTOR_EVENTS.CONNECTED, connectedListener);
|
|
125
|
+
web3Auth.on(noModal.CONNECTOR_EVENTS.AUTHORIZED, authorizedListener);
|
|
113
126
|
web3Auth.on(noModal.CONNECTOR_EVENTS.DISCONNECTED, disconnectedListener);
|
|
114
127
|
web3Auth.on(noModal.CONNECTOR_EVENTS.CONNECTING, connectingListener);
|
|
115
128
|
web3Auth.on(noModal.CONNECTOR_EVENTS.ERRORED, errorListener);
|
|
@@ -118,14 +131,15 @@ function Web3AuthInnerProvider(params) {
|
|
|
118
131
|
}
|
|
119
132
|
return () => {
|
|
120
133
|
if (web3Auth) {
|
|
121
|
-
web3Auth.
|
|
122
|
-
web3Auth.
|
|
123
|
-
web3Auth.
|
|
124
|
-
web3Auth.
|
|
125
|
-
web3Auth.
|
|
126
|
-
web3Auth.
|
|
127
|
-
web3Auth.
|
|
128
|
-
web3Auth.
|
|
134
|
+
web3Auth.removeListener(noModal.CONNECTOR_EVENTS.NOT_READY, notReadyListener);
|
|
135
|
+
web3Auth.removeListener(noModal.CONNECTOR_EVENTS.READY, readyListener);
|
|
136
|
+
web3Auth.removeListener(noModal.CONNECTOR_EVENTS.CONNECTED, connectedListener);
|
|
137
|
+
web3Auth.removeListener(noModal.CONNECTOR_EVENTS.AUTHORIZED, authorizedListener);
|
|
138
|
+
web3Auth.removeListener(noModal.CONNECTOR_EVENTS.DISCONNECTED, disconnectedListener);
|
|
139
|
+
web3Auth.removeListener(noModal.CONNECTOR_EVENTS.CONNECTING, connectingListener);
|
|
140
|
+
web3Auth.removeListener(noModal.CONNECTOR_EVENTS.ERRORED, errorListener);
|
|
141
|
+
web3Auth.removeListener(noModal.CONNECTOR_EVENTS.REHYDRATION_ERROR, rehydrationErrorListener);
|
|
142
|
+
web3Auth.removeListener(noModal.CONNECTOR_EVENTS.MFA_ENABLED, mfaEnabledListener);
|
|
129
143
|
web3Auth.cleanup();
|
|
130
144
|
}
|
|
131
145
|
};
|
|
@@ -134,6 +148,7 @@ function Web3AuthInnerProvider(params) {
|
|
|
134
148
|
return {
|
|
135
149
|
web3Auth,
|
|
136
150
|
isConnected,
|
|
151
|
+
isAuthorized,
|
|
137
152
|
isInitialized,
|
|
138
153
|
provider,
|
|
139
154
|
status,
|
|
@@ -145,7 +160,7 @@ function Web3AuthInnerProvider(params) {
|
|
|
145
160
|
getPlugin,
|
|
146
161
|
setIsMFAEnabled
|
|
147
162
|
};
|
|
148
|
-
}, [web3Auth, isConnected, isMFAEnabled, setIsMFAEnabled, isInitialized, provider, status, getPlugin, isInitializing, initError, chainId, chainNamespace]);
|
|
163
|
+
}, [web3Auth, isConnected, isAuthorized, isMFAEnabled, setIsMFAEnabled, isInitialized, provider, status, getPlugin, isInitializing, initError, chainId, chainNamespace]);
|
|
149
164
|
return /*#__PURE__*/react.createElement(Web3AuthInnerContext.Provider, {
|
|
150
165
|
value
|
|
151
166
|
}, children);
|
|
@@ -6,7 +6,7 @@ var useWeb3AuthInner = require('./useWeb3AuthInner.js');
|
|
|
6
6
|
const useIdentityToken = () => {
|
|
7
7
|
const {
|
|
8
8
|
web3Auth,
|
|
9
|
-
|
|
9
|
+
isAuthorized
|
|
10
10
|
} = useWeb3AuthInner.useWeb3AuthInner();
|
|
11
11
|
const [loading, setLoading] = react.useState(false);
|
|
12
12
|
const [error, setError] = react.useState(null);
|
|
@@ -27,10 +27,14 @@ const useIdentityToken = () => {
|
|
|
27
27
|
}
|
|
28
28
|
}, [web3Auth]);
|
|
29
29
|
react.useEffect(() => {
|
|
30
|
-
if (!
|
|
30
|
+
if (!web3Auth) return;
|
|
31
|
+
if (!isAuthorized && token) {
|
|
31
32
|
setToken(null);
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
+
if (isAuthorized && !token) {
|
|
35
|
+
setToken(web3Auth.idToken);
|
|
36
|
+
}
|
|
37
|
+
}, [isAuthorized, token, web3Auth]);
|
|
34
38
|
return {
|
|
35
39
|
loading,
|
|
36
40
|
error,
|
|
@@ -6,6 +6,7 @@ const useWeb3Auth = () => {
|
|
|
6
6
|
const {
|
|
7
7
|
initError,
|
|
8
8
|
isConnected,
|
|
9
|
+
isAuthorized,
|
|
9
10
|
isInitialized,
|
|
10
11
|
isInitializing,
|
|
11
12
|
provider,
|
|
@@ -16,6 +17,7 @@ const useWeb3Auth = () => {
|
|
|
16
17
|
return {
|
|
17
18
|
initError,
|
|
18
19
|
isConnected,
|
|
20
|
+
isAuthorized,
|
|
19
21
|
isInitialized,
|
|
20
22
|
isInitializing,
|
|
21
23
|
provider,
|
|
@@ -11,7 +11,9 @@ function BottomSheet({
|
|
|
11
11
|
isShown,
|
|
12
12
|
onClose,
|
|
13
13
|
children,
|
|
14
|
-
uiConfig
|
|
14
|
+
uiConfig,
|
|
15
|
+
sheetClassName,
|
|
16
|
+
showCloseButton = true
|
|
15
17
|
}) {
|
|
16
18
|
const {
|
|
17
19
|
borderRadiusType = "large"
|
|
@@ -34,8 +36,8 @@ function BottomSheet({
|
|
|
34
36
|
"w3a--rounded-[30px]": borderRadiusType === "large",
|
|
35
37
|
"w3a--rounded-2xl": borderRadiusType === "medium",
|
|
36
38
|
"w3a--rounded-none": borderRadiusType === "small"
|
|
37
|
-
}),
|
|
38
|
-
children: [jsxRuntime.jsx("div", {
|
|
39
|
+
}, sheetClassName),
|
|
40
|
+
children: [showCloseButton && jsxRuntime.jsx("div", {
|
|
39
41
|
className: "w3a--absolute w3a--right-4 w3a--top-[16px] w3a--z-10 w3a--cursor-pointer",
|
|
40
42
|
children: jsxRuntime.jsx("svg", {
|
|
41
43
|
width: "13",
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var utils = require('../../utils.js');
|
|
5
|
+
|
|
6
|
+
function toSize(value, fallback = 160) {
|
|
7
|
+
return value !== null && value !== void 0 ? value : fallback;
|
|
8
|
+
}
|
|
9
|
+
const CircularLoader = props => {
|
|
10
|
+
const {
|
|
11
|
+
width,
|
|
12
|
+
height,
|
|
13
|
+
thickness = 12,
|
|
14
|
+
className = "",
|
|
15
|
+
children,
|
|
16
|
+
showChildren = true,
|
|
17
|
+
trackColor = "rgba(226, 232, 240, 1)",
|
|
18
|
+
// Tailwind slate-200 equivalent
|
|
19
|
+
gradient,
|
|
20
|
+
arcSizeDeg = 36,
|
|
21
|
+
arcColors
|
|
22
|
+
} = props;
|
|
23
|
+
const w = toSize(width, 160);
|
|
24
|
+
const h = toSize(height, 160);
|
|
25
|
+
const ringMask = `radial-gradient(farthest-side, transparent calc(100% - ${thickness}px), #000 calc(100% - ${thickness}px))`;
|
|
26
|
+
function hexToRgba(hex, alpha) {
|
|
27
|
+
const normalized = hex.replace("#", "");
|
|
28
|
+
const full = normalized.length === 3 ? normalized.split("").map(c => c + c).join("") : normalized;
|
|
29
|
+
const r = parseInt(full.substring(0, 2), 16);
|
|
30
|
+
const g = parseInt(full.substring(2, 4), 16);
|
|
31
|
+
const b = parseInt(full.substring(4, 6), 16);
|
|
32
|
+
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
33
|
+
}
|
|
34
|
+
function withAlpha(color, alpha) {
|
|
35
|
+
if (!color) return color;
|
|
36
|
+
const c = color.trim().toLowerCase();
|
|
37
|
+
if (c.startsWith("#")) return hexToRgba(c, alpha);
|
|
38
|
+
if (c.startsWith("rgba(")) return color;
|
|
39
|
+
if (c.startsWith("rgb(")) {
|
|
40
|
+
const nums = c.slice(4, -1);
|
|
41
|
+
return `rgba(${nums}, ${alpha})`;
|
|
42
|
+
}
|
|
43
|
+
// Fallback: return the same color (alpha may be ignored by browser)
|
|
44
|
+
return color;
|
|
45
|
+
}
|
|
46
|
+
const arcColorGradient = gradient || (arcColors ? `radial-gradient(210.91% 85.29% at 14.56% 18.67%, ${withAlpha(arcColors[0], 0)} 9.5%, ${arcColors[1]} 41.82%, ${arcColors[1]} 64.83%, ${withAlpha(arcColors[0], 0.44)} 100%)` : "radial-gradient(210.91% 85.29% at 14.56% 18.67%, rgba(255, 98, 58, 0.00) 9.5%, #FF623A 41.82%, #FF623A 64.83%, rgba(255, 98, 58, 0.44) 100%)");
|
|
47
|
+
const wedgeMask = `conic-gradient(#000 0deg ${arcSizeDeg}deg, transparent ${arcSizeDeg}deg 360deg)`;
|
|
48
|
+
return jsxRuntime.jsxs("div", {
|
|
49
|
+
className: utils.cn("w3a--relative w3a--inline-flex w3a--items-center w3a--justify-center", className),
|
|
50
|
+
style: {
|
|
51
|
+
width: w,
|
|
52
|
+
height: h
|
|
53
|
+
},
|
|
54
|
+
children: [jsxRuntime.jsx("div", {
|
|
55
|
+
className: "w3a--absolute w3a--inset-0 w3a--rounded-full",
|
|
56
|
+
style: {
|
|
57
|
+
background: trackColor,
|
|
58
|
+
WebkitMaskImage: ringMask,
|
|
59
|
+
maskImage: ringMask,
|
|
60
|
+
WebkitMaskRepeat: "no-repeat",
|
|
61
|
+
maskRepeat: "no-repeat"
|
|
62
|
+
}
|
|
63
|
+
}), jsxRuntime.jsx("div", {
|
|
64
|
+
className: "w3a--absolute w3a--inset-0 w3a--animate-spin",
|
|
65
|
+
style: {
|
|
66
|
+
WebkitMaskImage: wedgeMask,
|
|
67
|
+
maskImage: wedgeMask,
|
|
68
|
+
WebkitMaskRepeat: "no-repeat",
|
|
69
|
+
maskRepeat: "no-repeat"
|
|
70
|
+
},
|
|
71
|
+
children: jsxRuntime.jsx("div", {
|
|
72
|
+
className: "w3a--absolute w3a--inset-0 w3a--rounded-full",
|
|
73
|
+
style: {
|
|
74
|
+
background: arcColorGradient,
|
|
75
|
+
WebkitMaskImage: ringMask,
|
|
76
|
+
maskImage: ringMask,
|
|
77
|
+
WebkitMaskRepeat: "no-repeat",
|
|
78
|
+
maskRepeat: "no-repeat"
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
}), showChildren && children ? jsxRuntime.jsx("div", {
|
|
82
|
+
className: "w3a--relative",
|
|
83
|
+
children: children
|
|
84
|
+
}) : null]
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
module.exports = CircularLoader;
|
|
@@ -43,7 +43,7 @@ const ConnectWalletChainNamespaceSelect = props => {
|
|
|
43
43
|
extension: wallet.imgExtension
|
|
44
44
|
})
|
|
45
45
|
}), jsxRuntime.jsx("p", {
|
|
46
|
-
className: "w3a--my-6 w3a--text-center w3a--text-sm w3a--text-app-gray-500",
|
|
46
|
+
className: "w3a--my-6 w3a--text-center w3a--text-sm w3a--text-app-gray-500 dark:w3a--text-app-gray-400",
|
|
47
47
|
children: t("modal.external.select-chain-description", {
|
|
48
48
|
wallet: wallet.displayName
|
|
49
49
|
})
|
|
@@ -72,7 +72,7 @@ const ConnectWalletChainNamespaceSelect = props => {
|
|
|
72
72
|
isButton: true,
|
|
73
73
|
extension: "svg"
|
|
74
74
|
}), jsxRuntime.jsx("p", {
|
|
75
|
-
className: "w3a--ml-2 w3a--text-left w3a--text-sm first-letter:w3a--capitalize",
|
|
75
|
+
className: "w3a--ml-2 w3a--text-left w3a--text-sm w3a--text-app-gray-900 first-letter:w3a--capitalize dark:w3a--text-app-gray-200",
|
|
76
76
|
children: displayName
|
|
77
77
|
})]
|
|
78
78
|
}), jsxRuntime.jsx("img", {
|
|
@@ -5,6 +5,7 @@ var react = require('react');
|
|
|
5
5
|
var reactI18next = require('react-i18next');
|
|
6
6
|
var interfaces = require('../../interfaces.js');
|
|
7
7
|
var localeImport = require('../../localeImport.js');
|
|
8
|
+
var CircularLoader = require('../CircularLoader/CircularLoader.js');
|
|
8
9
|
var Image = require('../Image/Image.js');
|
|
9
10
|
var PulseLoader = require('../PulseLoader/PulseLoader.js');
|
|
10
11
|
|
|
@@ -113,6 +114,56 @@ function ErroredStatus(props) {
|
|
|
113
114
|
})]
|
|
114
115
|
});
|
|
115
116
|
}
|
|
117
|
+
function AuthorizingStatus(props) {
|
|
118
|
+
var _walletRegistry$defau, _walletRegistry$other;
|
|
119
|
+
const [t] = reactI18next.useTranslation(undefined, {
|
|
120
|
+
i18n: localeImport
|
|
121
|
+
});
|
|
122
|
+
const {
|
|
123
|
+
connector,
|
|
124
|
+
externalWalletsConfig,
|
|
125
|
+
walletRegistry,
|
|
126
|
+
handleMobileVerifyConnect
|
|
127
|
+
} = props;
|
|
128
|
+
const registryItem = (walletRegistry === null || walletRegistry === void 0 || (_walletRegistry$defau = walletRegistry.default) === null || _walletRegistry$defau === void 0 ? void 0 : _walletRegistry$defau[connector]) || (walletRegistry === null || walletRegistry === void 0 || (_walletRegistry$other = walletRegistry.others) === null || _walletRegistry$other === void 0 ? void 0 : _walletRegistry$other[connector]);
|
|
129
|
+
const primaryColor = (registryItem === null || registryItem === void 0 ? void 0 : registryItem.primaryColor) || "";
|
|
130
|
+
const handleMobileVerifyConnectClick = () => {
|
|
131
|
+
handleMobileVerifyConnect({
|
|
132
|
+
connector: connector
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
return jsxRuntime.jsxs("div", {
|
|
136
|
+
className: "w3a--flex w3a--size-full w3a--flex-col w3a--items-center w3a--justify-between w3a--gap-y-6",
|
|
137
|
+
children: [jsxRuntime.jsx("p", {
|
|
138
|
+
className: "w3a--p-2 w3a--text-center w3a--text-base w3a--font-semibold w3a--text-app-gray-900 dark:w3a--text-app-white",
|
|
139
|
+
children: t("modal.loader.authorizing-header", {
|
|
140
|
+
connector: externalWalletsConfig[connector].label
|
|
141
|
+
})
|
|
142
|
+
}), jsxRuntime.jsx("div", {
|
|
143
|
+
className: "w3a--flex w3a--justify-center",
|
|
144
|
+
children: jsxRuntime.jsx(CircularLoader, {
|
|
145
|
+
width: 95,
|
|
146
|
+
height: 95,
|
|
147
|
+
thickness: 6,
|
|
148
|
+
arcSizeDeg: 100,
|
|
149
|
+
arcColors: primaryColor ? [primaryColor, primaryColor] : undefined,
|
|
150
|
+
children: jsxRuntime.jsx(Image, {
|
|
151
|
+
imageId: `login-${connector}`,
|
|
152
|
+
hoverImageId: `login-${connector}`,
|
|
153
|
+
height: "45",
|
|
154
|
+
width: "45"
|
|
155
|
+
})
|
|
156
|
+
})
|
|
157
|
+
}), jsxRuntime.jsx("p", {
|
|
158
|
+
className: "w3a--text-center w3a--text-sm w3a--text-app-gray-500 dark:w3a--text-app-gray-400",
|
|
159
|
+
children: t("modal.loader.authorizing-message")
|
|
160
|
+
}), jsxRuntime.jsx("button", {
|
|
161
|
+
onClick: handleMobileVerifyConnectClick,
|
|
162
|
+
className: "w3a--w-full w3a--rounded-xl w3a--bg-app-gray-100 w3a--p-2 w3a--py-3 w3a--text-center w3a--text-sm w3a--text-app-gray-900 dark:w3a--bg-app-gray-800 dark:w3a--text-app-white md:w3a--hidden",
|
|
163
|
+
children: t("modal.loader.authorizing-verify-btn")
|
|
164
|
+
})]
|
|
165
|
+
});
|
|
166
|
+
}
|
|
116
167
|
/**
|
|
117
168
|
* Loader component
|
|
118
169
|
* @param props - LoaderProps
|
|
@@ -125,25 +176,36 @@ function Loader(props) {
|
|
|
125
176
|
modalStatus,
|
|
126
177
|
onClose,
|
|
127
178
|
appLogo,
|
|
128
|
-
message
|
|
179
|
+
message,
|
|
180
|
+
isConnectAndSignAuthenticationMode,
|
|
181
|
+
externalWalletsConfig,
|
|
182
|
+
walletRegistry,
|
|
183
|
+
handleMobileVerifyConnect
|
|
129
184
|
} = props;
|
|
185
|
+
const isConnectedAccordingToAuthenticationMode = react.useMemo(() => !isConnectAndSignAuthenticationMode && modalStatus === interfaces.MODAL_STATUS.CONNECTED || isConnectAndSignAuthenticationMode && modalStatus === interfaces.MODAL_STATUS.AUTHORIZED, [modalStatus, isConnectAndSignAuthenticationMode]);
|
|
130
186
|
react.useEffect(() => {
|
|
131
|
-
if (
|
|
132
|
-
setTimeout(() => {
|
|
187
|
+
if (isConnectedAccordingToAuthenticationMode) {
|
|
188
|
+
const timeout = setTimeout(() => {
|
|
133
189
|
onClose();
|
|
134
190
|
}, 1000);
|
|
191
|
+
return () => clearTimeout(timeout);
|
|
135
192
|
}
|
|
136
|
-
}, [
|
|
193
|
+
}, [isConnectedAccordingToAuthenticationMode, onClose]);
|
|
137
194
|
return jsxRuntime.jsxs("div", {
|
|
138
195
|
className: "w3a--flex w3a--h-full w3a--flex-1 w3a--flex-col w3a--items-center w3a--justify-center w3a--gap-y-4",
|
|
139
196
|
children: [modalStatus === interfaces.MODAL_STATUS.CONNECTING && jsxRuntime.jsx(ConnectingStatus, {
|
|
140
197
|
connector: connector,
|
|
141
198
|
connectorName: connectorName,
|
|
142
199
|
appLogo: appLogo
|
|
143
|
-
}),
|
|
200
|
+
}), isConnectedAccordingToAuthenticationMode && jsxRuntime.jsx(ConnectedStatus, {
|
|
144
201
|
message: message
|
|
145
202
|
}), modalStatus === interfaces.MODAL_STATUS.ERRORED && jsxRuntime.jsx(ErroredStatus, {
|
|
146
203
|
message: message
|
|
204
|
+
}), modalStatus === interfaces.MODAL_STATUS.AUTHORIZING && jsxRuntime.jsx(AuthorizingStatus, {
|
|
205
|
+
connector: connector,
|
|
206
|
+
externalWalletsConfig: externalWalletsConfig,
|
|
207
|
+
walletRegistry: walletRegistry,
|
|
208
|
+
handleMobileVerifyConnect: handleMobileVerifyConnect
|
|
147
209
|
})]
|
|
148
210
|
});
|
|
149
211
|
}
|
|
@@ -28,6 +28,7 @@ function Root(props) {
|
|
|
28
28
|
setModalState,
|
|
29
29
|
modalState,
|
|
30
30
|
handleExternalWalletBtnClick,
|
|
31
|
+
handleMobileVerifyConnect,
|
|
31
32
|
chainNamespaces,
|
|
32
33
|
walletRegistry,
|
|
33
34
|
appLogo,
|
|
@@ -44,7 +45,8 @@ function Root(props) {
|
|
|
44
45
|
isSmsPasswordLessLoginVisible,
|
|
45
46
|
preHandleExternalWalletClick,
|
|
46
47
|
uiConfig,
|
|
47
|
-
deviceDetails
|
|
48
|
+
deviceDetails,
|
|
49
|
+
isConnectAndSignAuthenticationMode
|
|
48
50
|
} = props;
|
|
49
51
|
const {
|
|
50
52
|
logoAlignment = "center",
|
|
@@ -375,7 +377,11 @@ function Root(props) {
|
|
|
375
377
|
connectorName: modalState.detailedLoaderConnectorName,
|
|
376
378
|
modalStatus: modalState.status,
|
|
377
379
|
onClose: onCloseLoader,
|
|
378
|
-
appLogo: appLogo
|
|
380
|
+
appLogo: appLogo,
|
|
381
|
+
isConnectAndSignAuthenticationMode: isConnectAndSignAuthenticationMode,
|
|
382
|
+
externalWalletsConfig: modalState.externalWalletsConfig,
|
|
383
|
+
walletRegistry: walletRegistry,
|
|
384
|
+
handleMobileVerifyConnect: handleMobileVerifyConnect
|
|
379
385
|
}) : jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
380
386
|
children: (_bodyState$metamaskQr3 = bodyState.metamaskQrCode) !== null && _bodyState$metamaskQr3 !== void 0 && _bodyState$metamaskQr3.show ? jsxRuntime.jsxs("div", {
|
|
381
387
|
className: "w3a--relative w3a--flex w3a--flex-1 w3a--flex-col w3a--gap-y-4",
|
|
@@ -17,6 +17,7 @@ function Widget(props) {
|
|
|
17
17
|
stateListener,
|
|
18
18
|
handleSocialLoginClick,
|
|
19
19
|
handleExternalWalletClick,
|
|
20
|
+
handleMobileVerifyConnect,
|
|
20
21
|
handleShowExternalWallets,
|
|
21
22
|
closeModal,
|
|
22
23
|
appLogo,
|
|
@@ -24,7 +25,8 @@ function Widget(props) {
|
|
|
24
25
|
chainNamespaces,
|
|
25
26
|
walletRegistry,
|
|
26
27
|
uiConfig,
|
|
27
|
-
deviceDetails
|
|
28
|
+
deviceDetails,
|
|
29
|
+
initialAuthenticationMode
|
|
28
30
|
} = props;
|
|
29
31
|
const {
|
|
30
32
|
widgetType
|
|
@@ -55,6 +57,7 @@ function Widget(props) {
|
|
|
55
57
|
web3authNetwork: auth.WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
|
|
56
58
|
authBuildEnv: auth.BUILD_ENV.PRODUCTION
|
|
57
59
|
});
|
|
60
|
+
const isConnectAndSignAuthenticationMode = react.useMemo(() => initialAuthenticationMode === noModal.CONNECTOR_INITIAL_AUTHENTICATION_MODE.CONNECT_AND_SIGN, [initialAuthenticationMode]);
|
|
58
61
|
react.useEffect(() => {
|
|
59
62
|
setModalState(prev => _objectSpread(_objectSpread({}, prev), {}, {
|
|
60
63
|
modalVisibility: visible
|
|
@@ -141,7 +144,13 @@ function Widget(props) {
|
|
|
141
144
|
closeModal();
|
|
142
145
|
};
|
|
143
146
|
const onCloseLoader = () => {
|
|
144
|
-
if (modalState.status === interfaces.MODAL_STATUS.CONNECTED) {
|
|
147
|
+
if (!isConnectAndSignAuthenticationMode && modalState.status === interfaces.MODAL_STATUS.CONNECTED) {
|
|
148
|
+
setModalState(_objectSpread(_objectSpread({}, modalState), {}, {
|
|
149
|
+
modalVisibility: false,
|
|
150
|
+
externalWalletsVisibility: false
|
|
151
|
+
}));
|
|
152
|
+
}
|
|
153
|
+
if (isConnectAndSignAuthenticationMode && modalState.status === interfaces.MODAL_STATUS.AUTHORIZED) {
|
|
145
154
|
setModalState(_objectSpread(_objectSpread({}, modalState), {}, {
|
|
146
155
|
modalVisibility: false,
|
|
147
156
|
externalWalletsVisibility: false
|
|
@@ -155,7 +164,7 @@ function Widget(props) {
|
|
|
155
164
|
}
|
|
156
165
|
};
|
|
157
166
|
const showCloseIcon = react.useMemo(() => {
|
|
158
|
-
return modalState.status === interfaces.MODAL_STATUS.INITIALIZED || modalState.status === interfaces.MODAL_STATUS.CONNECTED || modalState.status === interfaces.MODAL_STATUS.ERRORED;
|
|
167
|
+
return modalState.status === interfaces.MODAL_STATUS.INITIALIZED || modalState.status === interfaces.MODAL_STATUS.CONNECTED || modalState.status === interfaces.MODAL_STATUS.ERRORED || modalState.status === interfaces.MODAL_STATUS.AUTHORIZED;
|
|
159
168
|
}, [modalState.status]);
|
|
160
169
|
react.useEffect(() => {
|
|
161
170
|
// TODO: maybe move this inside root
|
|
@@ -200,7 +209,9 @@ function Widget(props) {
|
|
|
200
209
|
isEmailPasswordLessLoginVisible: isEmailPasswordLessLoginVisible,
|
|
201
210
|
isSmsPasswordLessLoginVisible: isSmsPasswordLessLoginVisible,
|
|
202
211
|
uiConfig: uiConfig,
|
|
203
|
-
deviceDetails: deviceDetails
|
|
212
|
+
deviceDetails: deviceDetails,
|
|
213
|
+
isConnectAndSignAuthenticationMode: isConnectAndSignAuthenticationMode,
|
|
214
|
+
handleMobileVerifyConnect: handleMobileVerifyConnect
|
|
204
215
|
})
|
|
205
216
|
});
|
|
206
217
|
}
|
|
@@ -230,7 +241,9 @@ function Widget(props) {
|
|
|
230
241
|
isEmailPasswordLessLoginVisible: isEmailPasswordLessLoginVisible,
|
|
231
242
|
isSmsPasswordLessLoginVisible: isSmsPasswordLessLoginVisible,
|
|
232
243
|
uiConfig: uiConfig,
|
|
233
|
-
deviceDetails: deviceDetails
|
|
244
|
+
deviceDetails: deviceDetails,
|
|
245
|
+
isConnectAndSignAuthenticationMode: isConnectAndSignAuthenticationMode,
|
|
246
|
+
handleMobileVerifyConnect: handleMobileVerifyConnect
|
|
234
247
|
})
|
|
235
248
|
});
|
|
236
249
|
}
|