@agg-build/auth 1.2.0 → 2.0.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/{chunk-LANCSYI6.mjs → chunk-ASAWLLUV.mjs} +47 -3
- package/dist/connect-button.d.mts +1 -1
- package/dist/connect-button.d.ts +1 -1
- package/dist/connect-button.js +27 -1
- package/dist/connect-button.mjs +1 -1
- package/dist/email.d.mts +1 -1
- package/dist/email.d.ts +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +42 -1
- package/dist/index.mjs +1 -1
- package/dist/oauth.d.mts +1 -1
- package/dist/oauth.d.ts +1 -1
- package/dist/siwe.d.mts +1 -1
- package/dist/siwe.d.ts +1 -1
- package/dist/siws.d.mts +1 -1
- package/dist/siws.d.ts +1 -1
- package/dist/{types-D-OXBxXn.d.mts → types-__sOgyJH.d.mts} +5 -0
- package/dist/{types-D-OXBxXn.d.ts → types-__sOgyJH.d.ts} +5 -0
- package/package.json +3 -3
|
@@ -11,8 +11,11 @@ import {
|
|
|
11
11
|
} from "./chunk-AXBFBHS2.mjs";
|
|
12
12
|
|
|
13
13
|
// src/connect-button/index.tsx
|
|
14
|
-
import { useEffect as useEffect2, useMemo as useMemo2, useState as useState2 } from "react";
|
|
15
|
-
import {
|
|
14
|
+
import { useEffect as useEffect2, useMemo as useMemo2, useRef as useRef2, useState as useState2 } from "react";
|
|
15
|
+
import {
|
|
16
|
+
AuthConnectButtonView,
|
|
17
|
+
useOptionalToast
|
|
18
|
+
} from "@agg-build/ui";
|
|
16
19
|
import {
|
|
17
20
|
AUTH_CHOOSER_OPEN_EVENT,
|
|
18
21
|
getWalletAddressFromUserProfile as getWalletAddressFromUserProfile2,
|
|
@@ -54,8 +57,10 @@ var AggAuthProvider = ({
|
|
|
54
57
|
const [error, setError] = useState(null);
|
|
55
58
|
const [notice, setNotice] = useState(null);
|
|
56
59
|
const [challengeSiteKey, setChallengeSiteKey] = useState(null);
|
|
60
|
+
const [challengeCompletion, setChallengeCompletion] = useState(null);
|
|
57
61
|
const pendingMethodIdRef = useRef(null);
|
|
58
62
|
const pendingInputRef = useRef(void 0);
|
|
63
|
+
const challengeCompletionSequenceRef = useRef(0);
|
|
59
64
|
const challengeTimeoutRef = useRef(null);
|
|
60
65
|
useEffect(() => {
|
|
61
66
|
if (!autoHandleAuthCallback || handledCallbackRef.current) return;
|
|
@@ -68,6 +73,7 @@ var AggAuthProvider = ({
|
|
|
68
73
|
if (!auth.isAuthenticated) return;
|
|
69
74
|
setNotice(null);
|
|
70
75
|
setChallengeSiteKey(null);
|
|
76
|
+
setChallengeCompletion(null);
|
|
71
77
|
pendingMethodIdRef.current = null;
|
|
72
78
|
pendingInputRef.current = void 0;
|
|
73
79
|
}, [auth.isAuthenticated]);
|
|
@@ -98,6 +104,9 @@ var AggAuthProvider = ({
|
|
|
98
104
|
setError(null);
|
|
99
105
|
setNotice(null);
|
|
100
106
|
setChallengeSiteKey(null);
|
|
107
|
+
setChallengeCompletion(null);
|
|
108
|
+
pendingMethodIdRef.current = null;
|
|
109
|
+
pendingInputRef.current = void 0;
|
|
101
110
|
auth.clearError();
|
|
102
111
|
}, [auth]);
|
|
103
112
|
const startMethod = useCallback(
|
|
@@ -110,6 +119,7 @@ var AggAuthProvider = ({
|
|
|
110
119
|
}
|
|
111
120
|
setError(null);
|
|
112
121
|
setNotice(null);
|
|
122
|
+
setChallengeCompletion(null);
|
|
113
123
|
setActiveMethodId(methodId);
|
|
114
124
|
setSelectedMethodId(methodId);
|
|
115
125
|
try {
|
|
@@ -167,6 +177,10 @@ var AggAuthProvider = ({
|
|
|
167
177
|
if (result == null ? void 0 : result.notice) {
|
|
168
178
|
setNotice(result.notice);
|
|
169
179
|
}
|
|
180
|
+
setChallengeCompletion({
|
|
181
|
+
methodId,
|
|
182
|
+
sequence: challengeCompletionSequenceRef.current += 1
|
|
183
|
+
});
|
|
170
184
|
} catch (retryError) {
|
|
171
185
|
setError(normalizeAuthError(toError(retryError)));
|
|
172
186
|
} finally {
|
|
@@ -179,6 +193,7 @@ var AggAuthProvider = ({
|
|
|
179
193
|
setChallengeSiteKey(null);
|
|
180
194
|
pendingMethodIdRef.current = null;
|
|
181
195
|
pendingInputRef.current = void 0;
|
|
196
|
+
setChallengeCompletion(null);
|
|
182
197
|
setError(new Error("Bot protection check failed. Please try again."));
|
|
183
198
|
setActiveMethodId(null);
|
|
184
199
|
}, []);
|
|
@@ -186,6 +201,7 @@ var AggAuthProvider = ({
|
|
|
186
201
|
setError(null);
|
|
187
202
|
setNotice(null);
|
|
188
203
|
setChallengeSiteKey(null);
|
|
204
|
+
setChallengeCompletion(null);
|
|
189
205
|
yield auth.signOut();
|
|
190
206
|
yield Promise.allSettled(
|
|
191
207
|
methods.map((method) => __async(null, null, function* () {
|
|
@@ -199,6 +215,7 @@ var AggAuthProvider = ({
|
|
|
199
215
|
return {
|
|
200
216
|
activeMethodId,
|
|
201
217
|
availableMethods,
|
|
218
|
+
challengeCompletion,
|
|
202
219
|
challengeSiteKey,
|
|
203
220
|
configuredMethods: methods,
|
|
204
221
|
error: error != null ? error : auth.error ? normalizeAuthError(auth.error) : null,
|
|
@@ -216,6 +233,7 @@ var AggAuthProvider = ({
|
|
|
216
233
|
auth.error,
|
|
217
234
|
auth.isLoading,
|
|
218
235
|
availableMethods,
|
|
236
|
+
challengeCompletion,
|
|
219
237
|
challengeSiteKey,
|
|
220
238
|
clearFeedback,
|
|
221
239
|
error,
|
|
@@ -349,6 +367,7 @@ var ConnectButton = ({
|
|
|
349
367
|
const [isProfileMenuOpen, setIsProfileMenuOpen] = useState2(false);
|
|
350
368
|
const {
|
|
351
369
|
activeMethodId,
|
|
370
|
+
challengeCompletion,
|
|
352
371
|
challengeSiteKey,
|
|
353
372
|
clearFeedback,
|
|
354
373
|
configuredMethods,
|
|
@@ -361,6 +380,9 @@ var ConnectButton = ({
|
|
|
361
380
|
startMethod
|
|
362
381
|
} = useAggAuthFlow();
|
|
363
382
|
const { isAuthenticated, user } = useAggAuthContext2();
|
|
383
|
+
const toastContext = useOptionalToast();
|
|
384
|
+
const handledChallengeCompletionSequenceRef = useRef2(null);
|
|
385
|
+
const toastedNoticeRef = useRef2(null);
|
|
364
386
|
const {
|
|
365
387
|
totalBalance,
|
|
366
388
|
positionsBalanceTotal,
|
|
@@ -379,6 +401,28 @@ var ConnectButton = ({
|
|
|
379
401
|
setIsChooserOpen(false);
|
|
380
402
|
setEmailError(null);
|
|
381
403
|
}, [isAuthenticated]);
|
|
404
|
+
useEffect2(() => {
|
|
405
|
+
if (!toastContext) return;
|
|
406
|
+
if (!notice) {
|
|
407
|
+
toastedNoticeRef.current = null;
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
if (toastedNoticeRef.current === notice) return;
|
|
411
|
+
toastedNoticeRef.current = notice;
|
|
412
|
+
toastContext.toast(notice, { tone: "success" });
|
|
413
|
+
}, [notice, toastContext]);
|
|
414
|
+
useEffect2(() => {
|
|
415
|
+
if (!challengeCompletion) return;
|
|
416
|
+
if (handledChallengeCompletionSequenceRef.current === challengeCompletion.sequence) return;
|
|
417
|
+
handledChallengeCompletionSequenceRef.current = challengeCompletion.sequence;
|
|
418
|
+
void (() => __async(null, null, function* () {
|
|
419
|
+
yield Promise.resolve(onAuthMethodSelect == null ? void 0 : onAuthMethodSelect(challengeCompletion.methodId));
|
|
420
|
+
if (challengeCompletion.methodId === "email") {
|
|
421
|
+
setEmailValue("");
|
|
422
|
+
}
|
|
423
|
+
setIsChooserOpen(false);
|
|
424
|
+
}))();
|
|
425
|
+
}, [challengeCompletion, onAuthMethodSelect]);
|
|
382
426
|
useEffect2(() => {
|
|
383
427
|
if (typeof window === "undefined") return;
|
|
384
428
|
const handleOpenChooserRequest = () => {
|
|
@@ -494,7 +538,7 @@ var ConnectButton = ({
|
|
|
494
538
|
isBusy,
|
|
495
539
|
isChooserOpen,
|
|
496
540
|
isProfileMenuOpen,
|
|
497
|
-
notice,
|
|
541
|
+
notice: toastContext ? null : notice,
|
|
498
542
|
onChooserOpenChange: handleChooserOpenChange,
|
|
499
543
|
onDepositClick: handleDepositClick,
|
|
500
544
|
onDisconnectClick: () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
import { AuthConnectButtonViewButtonProps, AuthConnectButtonViewClassNames } from '@agg-build/ui';
|
|
3
|
-
import { c as AuthMethodId } from './types-
|
|
3
|
+
import { c as AuthMethodId } from './types-__sOgyJH.mjs';
|
|
4
4
|
import '@agg-build/hooks';
|
|
5
5
|
|
|
6
6
|
type ConnectButtonActionHandler = () => Promise<void> | void;
|
package/dist/connect-button.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
2
|
import { AuthConnectButtonViewButtonProps, AuthConnectButtonViewClassNames } from '@agg-build/ui';
|
|
3
|
-
import { c as AuthMethodId } from './types-
|
|
3
|
+
import { c as AuthMethodId } from './types-__sOgyJH.js';
|
|
4
4
|
import '@agg-build/hooks';
|
|
5
5
|
|
|
6
6
|
type ConnectButtonActionHandler = () => Promise<void> | void;
|
package/dist/connect-button.js
CHANGED
|
@@ -194,6 +194,7 @@ var ConnectButton = ({
|
|
|
194
194
|
const [isProfileMenuOpen, setIsProfileMenuOpen] = (0, import_react3.useState)(false);
|
|
195
195
|
const {
|
|
196
196
|
activeMethodId,
|
|
197
|
+
challengeCompletion,
|
|
197
198
|
challengeSiteKey,
|
|
198
199
|
clearFeedback,
|
|
199
200
|
configuredMethods,
|
|
@@ -206,6 +207,9 @@ var ConnectButton = ({
|
|
|
206
207
|
startMethod
|
|
207
208
|
} = useAggAuthFlow();
|
|
208
209
|
const { isAuthenticated, user } = (0, import_hooks3.useAggAuthContext)();
|
|
210
|
+
const toastContext = (0, import_ui.useOptionalToast)();
|
|
211
|
+
const handledChallengeCompletionSequenceRef = (0, import_react3.useRef)(null);
|
|
212
|
+
const toastedNoticeRef = (0, import_react3.useRef)(null);
|
|
209
213
|
const {
|
|
210
214
|
totalBalance,
|
|
211
215
|
positionsBalanceTotal,
|
|
@@ -224,6 +228,28 @@ var ConnectButton = ({
|
|
|
224
228
|
setIsChooserOpen(false);
|
|
225
229
|
setEmailError(null);
|
|
226
230
|
}, [isAuthenticated]);
|
|
231
|
+
(0, import_react3.useEffect)(() => {
|
|
232
|
+
if (!toastContext) return;
|
|
233
|
+
if (!notice) {
|
|
234
|
+
toastedNoticeRef.current = null;
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
if (toastedNoticeRef.current === notice) return;
|
|
238
|
+
toastedNoticeRef.current = notice;
|
|
239
|
+
toastContext.toast(notice, { tone: "success" });
|
|
240
|
+
}, [notice, toastContext]);
|
|
241
|
+
(0, import_react3.useEffect)(() => {
|
|
242
|
+
if (!challengeCompletion) return;
|
|
243
|
+
if (handledChallengeCompletionSequenceRef.current === challengeCompletion.sequence) return;
|
|
244
|
+
handledChallengeCompletionSequenceRef.current = challengeCompletion.sequence;
|
|
245
|
+
void (() => __async(null, null, function* () {
|
|
246
|
+
yield Promise.resolve(onAuthMethodSelect == null ? void 0 : onAuthMethodSelect(challengeCompletion.methodId));
|
|
247
|
+
if (challengeCompletion.methodId === "email") {
|
|
248
|
+
setEmailValue("");
|
|
249
|
+
}
|
|
250
|
+
setIsChooserOpen(false);
|
|
251
|
+
}))();
|
|
252
|
+
}, [challengeCompletion, onAuthMethodSelect]);
|
|
227
253
|
(0, import_react3.useEffect)(() => {
|
|
228
254
|
if (typeof window === "undefined") return;
|
|
229
255
|
const handleOpenChooserRequest = () => {
|
|
@@ -339,7 +365,7 @@ var ConnectButton = ({
|
|
|
339
365
|
isBusy,
|
|
340
366
|
isChooserOpen,
|
|
341
367
|
isProfileMenuOpen,
|
|
342
|
-
notice,
|
|
368
|
+
notice: toastContext ? null : notice,
|
|
343
369
|
onChooserOpenChange: handleChooserOpenChange,
|
|
344
370
|
onDepositClick: handleDepositClick,
|
|
345
371
|
onDisconnectClick: () => {
|
package/dist/connect-button.mjs
CHANGED
package/dist/email.d.mts
CHANGED
package/dist/email.d.ts
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AggAuthProviderProps, a as AggAuthFlowContextValue } from './types-
|
|
2
|
-
export { b as AuthMethodAdapter, c as AuthMethodId, d as AuthMethodInputDefinition, e as AuthMethodInputValue, f as AuthMethodStartContext, g as AuthMethodStartResult } from './types-
|
|
1
|
+
import { A as AggAuthProviderProps, a as AggAuthFlowContextValue } from './types-__sOgyJH.mjs';
|
|
2
|
+
export { b as AuthMethodAdapter, c as AuthMethodId, d as AuthMethodInputDefinition, e as AuthMethodInputValue, f as AuthMethodStartContext, g as AuthMethodStartResult } from './types-__sOgyJH.mjs';
|
|
3
3
|
import { useAggAuthContext } from '@agg-build/hooks';
|
|
4
4
|
export { ConnectButton, ConnectButtonButtonProps, ConnectButtonClassNames, ConnectButtonProps } from './connect-button.mjs';
|
|
5
5
|
export { createEmailAuthMethod } from './email.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AggAuthProviderProps, a as AggAuthFlowContextValue } from './types-
|
|
2
|
-
export { b as AuthMethodAdapter, c as AuthMethodId, d as AuthMethodInputDefinition, e as AuthMethodInputValue, f as AuthMethodStartContext, g as AuthMethodStartResult } from './types-
|
|
1
|
+
import { A as AggAuthProviderProps, a as AggAuthFlowContextValue } from './types-__sOgyJH.js';
|
|
2
|
+
export { b as AuthMethodAdapter, c as AuthMethodId, d as AuthMethodInputDefinition, e as AuthMethodInputValue, f as AuthMethodStartContext, g as AuthMethodStartResult } from './types-__sOgyJH.js';
|
|
3
3
|
import { useAggAuthContext } from '@agg-build/hooks';
|
|
4
4
|
export { ConnectButton, ConnectButtonButtonProps, ConnectButtonClassNames, ConnectButtonProps } from './connect-button.js';
|
|
5
5
|
export { createEmailAuthMethod } from './email.js';
|
package/dist/index.js
CHANGED
|
@@ -127,8 +127,10 @@ var AggAuthProvider = ({
|
|
|
127
127
|
const [error, setError] = (0, import_react.useState)(null);
|
|
128
128
|
const [notice, setNotice] = (0, import_react.useState)(null);
|
|
129
129
|
const [challengeSiteKey, setChallengeSiteKey] = (0, import_react.useState)(null);
|
|
130
|
+
const [challengeCompletion, setChallengeCompletion] = (0, import_react.useState)(null);
|
|
130
131
|
const pendingMethodIdRef = (0, import_react.useRef)(null);
|
|
131
132
|
const pendingInputRef = (0, import_react.useRef)(void 0);
|
|
133
|
+
const challengeCompletionSequenceRef = (0, import_react.useRef)(0);
|
|
132
134
|
const challengeTimeoutRef = (0, import_react.useRef)(null);
|
|
133
135
|
(0, import_react.useEffect)(() => {
|
|
134
136
|
if (!autoHandleAuthCallback || handledCallbackRef.current) return;
|
|
@@ -141,6 +143,7 @@ var AggAuthProvider = ({
|
|
|
141
143
|
if (!auth.isAuthenticated) return;
|
|
142
144
|
setNotice(null);
|
|
143
145
|
setChallengeSiteKey(null);
|
|
146
|
+
setChallengeCompletion(null);
|
|
144
147
|
pendingMethodIdRef.current = null;
|
|
145
148
|
pendingInputRef.current = void 0;
|
|
146
149
|
}, [auth.isAuthenticated]);
|
|
@@ -171,6 +174,9 @@ var AggAuthProvider = ({
|
|
|
171
174
|
setError(null);
|
|
172
175
|
setNotice(null);
|
|
173
176
|
setChallengeSiteKey(null);
|
|
177
|
+
setChallengeCompletion(null);
|
|
178
|
+
pendingMethodIdRef.current = null;
|
|
179
|
+
pendingInputRef.current = void 0;
|
|
174
180
|
auth.clearError();
|
|
175
181
|
}, [auth]);
|
|
176
182
|
const startMethod = (0, import_react.useCallback)(
|
|
@@ -183,6 +189,7 @@ var AggAuthProvider = ({
|
|
|
183
189
|
}
|
|
184
190
|
setError(null);
|
|
185
191
|
setNotice(null);
|
|
192
|
+
setChallengeCompletion(null);
|
|
186
193
|
setActiveMethodId(methodId);
|
|
187
194
|
setSelectedMethodId(methodId);
|
|
188
195
|
try {
|
|
@@ -240,6 +247,10 @@ var AggAuthProvider = ({
|
|
|
240
247
|
if (result == null ? void 0 : result.notice) {
|
|
241
248
|
setNotice(result.notice);
|
|
242
249
|
}
|
|
250
|
+
setChallengeCompletion({
|
|
251
|
+
methodId,
|
|
252
|
+
sequence: challengeCompletionSequenceRef.current += 1
|
|
253
|
+
});
|
|
243
254
|
} catch (retryError) {
|
|
244
255
|
setError(normalizeAuthError(toError(retryError)));
|
|
245
256
|
} finally {
|
|
@@ -252,6 +263,7 @@ var AggAuthProvider = ({
|
|
|
252
263
|
setChallengeSiteKey(null);
|
|
253
264
|
pendingMethodIdRef.current = null;
|
|
254
265
|
pendingInputRef.current = void 0;
|
|
266
|
+
setChallengeCompletion(null);
|
|
255
267
|
setError(new Error("Bot protection check failed. Please try again."));
|
|
256
268
|
setActiveMethodId(null);
|
|
257
269
|
}, []);
|
|
@@ -259,6 +271,7 @@ var AggAuthProvider = ({
|
|
|
259
271
|
setError(null);
|
|
260
272
|
setNotice(null);
|
|
261
273
|
setChallengeSiteKey(null);
|
|
274
|
+
setChallengeCompletion(null);
|
|
262
275
|
yield auth.signOut();
|
|
263
276
|
yield Promise.allSettled(
|
|
264
277
|
methods.map((method) => __async(null, null, function* () {
|
|
@@ -272,6 +285,7 @@ var AggAuthProvider = ({
|
|
|
272
285
|
return {
|
|
273
286
|
activeMethodId,
|
|
274
287
|
availableMethods,
|
|
288
|
+
challengeCompletion,
|
|
275
289
|
challengeSiteKey,
|
|
276
290
|
configuredMethods: methods,
|
|
277
291
|
error: error != null ? error : auth.error ? normalizeAuthError(auth.error) : null,
|
|
@@ -289,6 +303,7 @@ var AggAuthProvider = ({
|
|
|
289
303
|
auth.error,
|
|
290
304
|
auth.isLoading,
|
|
291
305
|
availableMethods,
|
|
306
|
+
challengeCompletion,
|
|
292
307
|
challengeSiteKey,
|
|
293
308
|
clearFeedback,
|
|
294
309
|
error,
|
|
@@ -459,6 +474,7 @@ var ConnectButton = ({
|
|
|
459
474
|
const [isProfileMenuOpen, setIsProfileMenuOpen] = (0, import_react4.useState)(false);
|
|
460
475
|
const {
|
|
461
476
|
activeMethodId,
|
|
477
|
+
challengeCompletion,
|
|
462
478
|
challengeSiteKey,
|
|
463
479
|
clearFeedback,
|
|
464
480
|
configuredMethods,
|
|
@@ -471,6 +487,9 @@ var ConnectButton = ({
|
|
|
471
487
|
startMethod
|
|
472
488
|
} = useAggAuthFlow();
|
|
473
489
|
const { isAuthenticated, user } = (0, import_hooks4.useAggAuthContext)();
|
|
490
|
+
const toastContext = (0, import_ui.useOptionalToast)();
|
|
491
|
+
const handledChallengeCompletionSequenceRef = (0, import_react4.useRef)(null);
|
|
492
|
+
const toastedNoticeRef = (0, import_react4.useRef)(null);
|
|
474
493
|
const {
|
|
475
494
|
totalBalance,
|
|
476
495
|
positionsBalanceTotal,
|
|
@@ -489,6 +508,28 @@ var ConnectButton = ({
|
|
|
489
508
|
setIsChooserOpen(false);
|
|
490
509
|
setEmailError(null);
|
|
491
510
|
}, [isAuthenticated]);
|
|
511
|
+
(0, import_react4.useEffect)(() => {
|
|
512
|
+
if (!toastContext) return;
|
|
513
|
+
if (!notice) {
|
|
514
|
+
toastedNoticeRef.current = null;
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
if (toastedNoticeRef.current === notice) return;
|
|
518
|
+
toastedNoticeRef.current = notice;
|
|
519
|
+
toastContext.toast(notice, { tone: "success" });
|
|
520
|
+
}, [notice, toastContext]);
|
|
521
|
+
(0, import_react4.useEffect)(() => {
|
|
522
|
+
if (!challengeCompletion) return;
|
|
523
|
+
if (handledChallengeCompletionSequenceRef.current === challengeCompletion.sequence) return;
|
|
524
|
+
handledChallengeCompletionSequenceRef.current = challengeCompletion.sequence;
|
|
525
|
+
void (() => __async(null, null, function* () {
|
|
526
|
+
yield Promise.resolve(onAuthMethodSelect == null ? void 0 : onAuthMethodSelect(challengeCompletion.methodId));
|
|
527
|
+
if (challengeCompletion.methodId === "email") {
|
|
528
|
+
setEmailValue("");
|
|
529
|
+
}
|
|
530
|
+
setIsChooserOpen(false);
|
|
531
|
+
}))();
|
|
532
|
+
}, [challengeCompletion, onAuthMethodSelect]);
|
|
492
533
|
(0, import_react4.useEffect)(() => {
|
|
493
534
|
if (typeof window === "undefined") return;
|
|
494
535
|
const handleOpenChooserRequest = () => {
|
|
@@ -604,7 +645,7 @@ var ConnectButton = ({
|
|
|
604
645
|
isBusy,
|
|
605
646
|
isChooserOpen,
|
|
606
647
|
isProfileMenuOpen,
|
|
607
|
-
notice,
|
|
648
|
+
notice: toastContext ? null : notice,
|
|
608
649
|
onChooserOpenChange: handleChooserOpenChange,
|
|
609
650
|
onDepositClick: handleDepositClick,
|
|
610
651
|
onDisconnectClick: () => {
|
package/dist/index.mjs
CHANGED
package/dist/oauth.d.mts
CHANGED
package/dist/oauth.d.ts
CHANGED
package/dist/siwe.d.mts
CHANGED
package/dist/siwe.d.ts
CHANGED
package/dist/siws.d.mts
CHANGED
package/dist/siws.d.ts
CHANGED
|
@@ -8,6 +8,10 @@ type AuthMethodChain = "ethereum" | "solana";
|
|
|
8
8
|
type AuthMethodInputValue = {
|
|
9
9
|
email?: string;
|
|
10
10
|
};
|
|
11
|
+
type AuthChallengeCompletion = {
|
|
12
|
+
methodId: AuthMethodId;
|
|
13
|
+
sequence: number;
|
|
14
|
+
};
|
|
11
15
|
type AuthMethodInputDefinition = {
|
|
12
16
|
type: "email";
|
|
13
17
|
placeholder?: string;
|
|
@@ -42,6 +46,7 @@ interface AggAuthProviderProps {
|
|
|
42
46
|
interface AggAuthFlowContextValue {
|
|
43
47
|
activeMethodId: AuthMethodId | null;
|
|
44
48
|
availableMethods: readonly AuthMethodAdapter[];
|
|
49
|
+
challengeCompletion: AuthChallengeCompletion | null;
|
|
45
50
|
challengeSiteKey: string | null;
|
|
46
51
|
configuredMethods: readonly AuthMethodAdapter[];
|
|
47
52
|
error: Error | null;
|
|
@@ -8,6 +8,10 @@ type AuthMethodChain = "ethereum" | "solana";
|
|
|
8
8
|
type AuthMethodInputValue = {
|
|
9
9
|
email?: string;
|
|
10
10
|
};
|
|
11
|
+
type AuthChallengeCompletion = {
|
|
12
|
+
methodId: AuthMethodId;
|
|
13
|
+
sequence: number;
|
|
14
|
+
};
|
|
11
15
|
type AuthMethodInputDefinition = {
|
|
12
16
|
type: "email";
|
|
13
17
|
placeholder?: string;
|
|
@@ -42,6 +46,7 @@ interface AggAuthProviderProps {
|
|
|
42
46
|
interface AggAuthFlowContextValue {
|
|
43
47
|
activeMethodId: AuthMethodId | null;
|
|
44
48
|
availableMethods: readonly AuthMethodAdapter[];
|
|
49
|
+
challengeCompletion: AuthChallengeCompletion | null;
|
|
45
50
|
challengeSiteKey: string | null;
|
|
46
51
|
configuredMethods: readonly AuthMethodAdapter[];
|
|
47
52
|
error: Error | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agg-build/auth",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Modular connect/sign-in UI and auth-method adapters (SIWE, SIWS, Google, Apple, Twitter/X, email magic-link) for the AGG prediction market aggregator.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -101,8 +101,8 @@
|
|
|
101
101
|
"wagmi": "^3.5.0",
|
|
102
102
|
"@solana/wallet-adapter-react": "^0.15.39",
|
|
103
103
|
"bs58": "^6.0.0",
|
|
104
|
-
"@agg-build/hooks": "^
|
|
105
|
-
"@agg-build/ui": "^
|
|
104
|
+
"@agg-build/hooks": "^2.0.0",
|
|
105
|
+
"@agg-build/ui": "^2.0.0"
|
|
106
106
|
},
|
|
107
107
|
"peerDependenciesMeta": {
|
|
108
108
|
"wagmi": {
|