shogun-button-react 4.3.5 → 4.3.6
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/components/ShogunButton.js +14 -4
- package/dist/connector.js +3 -3
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -191,8 +191,16 @@ export function ShogunButtonProvider({ children, core, options, onLoginSuccess,
|
|
|
191
191
|
throw new Error("Passwords do not match");
|
|
192
192
|
}
|
|
193
193
|
console.log(`[DEBUG] ShogunButton: Calling core.signUp for username: ${username}`);
|
|
194
|
-
|
|
195
|
-
console.log(`[DEBUG] ShogunButton: core.signUp
|
|
194
|
+
console.log(`[DEBUG] ShogunButton: core object:`, core);
|
|
195
|
+
console.log(`[DEBUG] ShogunButton: core.signUp exists:`, typeof (core === null || core === void 0 ? void 0 : core.signUp));
|
|
196
|
+
try {
|
|
197
|
+
result = await core.signUp(args[0], args[1]);
|
|
198
|
+
console.log(`[DEBUG] ShogunButton: core.signUp result:`, result);
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
console.error(`[DEBUG] ShogunButton: core.signUp error:`, error);
|
|
202
|
+
throw error;
|
|
203
|
+
}
|
|
196
204
|
break;
|
|
197
205
|
case "webauthn":
|
|
198
206
|
username = args[0];
|
|
@@ -557,12 +565,15 @@ export const ShogunButton = (() => {
|
|
|
557
565
|
}
|
|
558
566
|
// Event handlers
|
|
559
567
|
const handleAuth = async (method, ...args) => {
|
|
568
|
+
console.log(`[DEBUG] handleAuth called with method: ${method}, formMode: ${formMode}, args:`, args);
|
|
560
569
|
setError("");
|
|
561
570
|
setLoading(true);
|
|
562
571
|
try {
|
|
563
572
|
// Use formMode to determine whether to call login or signUp
|
|
564
573
|
const action = formMode === "login" ? login : signUp;
|
|
574
|
+
console.log(`[DEBUG] handleAuth calling action: ${action.name}, method: ${method}`);
|
|
565
575
|
const result = await action(method, ...args);
|
|
576
|
+
console.log(`[DEBUG] handleAuth result:`, result);
|
|
566
577
|
if (result && !result.success && result.error) {
|
|
567
578
|
setError(result.error);
|
|
568
579
|
}
|
|
@@ -582,6 +593,7 @@ export const ShogunButton = (() => {
|
|
|
582
593
|
};
|
|
583
594
|
const handleSubmit = async (e) => {
|
|
584
595
|
e.preventDefault();
|
|
596
|
+
console.log(`[DEBUG] handleSubmit called, formMode: ${formMode}, username: ${formUsername}`);
|
|
585
597
|
setError("");
|
|
586
598
|
setLoading(true);
|
|
587
599
|
try {
|
|
@@ -618,7 +630,6 @@ export const ShogunButton = (() => {
|
|
|
618
630
|
setLoading(false);
|
|
619
631
|
}
|
|
620
632
|
};
|
|
621
|
-
const handleWeb3Auth = () => handleAuth("web3");
|
|
622
633
|
const handleWebAuthnAuth = () => {
|
|
623
634
|
if (!(core === null || core === void 0 ? void 0 : core.hasPlugin("webauthn"))) {
|
|
624
635
|
setError("WebAuthn is not supported in your browser");
|
|
@@ -626,7 +637,6 @@ export const ShogunButton = (() => {
|
|
|
626
637
|
}
|
|
627
638
|
setAuthView("webauthn-username");
|
|
628
639
|
};
|
|
629
|
-
const handleNostrAuth = () => handleAuth("nostr");
|
|
630
640
|
const handleZkProofAuth = () => {
|
|
631
641
|
if (!(core === null || core === void 0 ? void 0 : core.hasPlugin("zkproof"))) {
|
|
632
642
|
setError("ZK-Proof plugin not available");
|
package/dist/connector.js
CHANGED
|
@@ -24,12 +24,12 @@ export async function shogunConnector(options) {
|
|
|
24
24
|
}
|
|
25
25
|
// Wait for core to initialize (plugins registration, etc.)
|
|
26
26
|
try {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
27
|
+
await core.initialize();
|
|
28
|
+
console.log(`[DEBUG] ShogunConnector: ShogunCore initialized`);
|
|
30
29
|
}
|
|
31
30
|
catch (error) {
|
|
32
31
|
console.error("Error initializing ShogunCore:", error);
|
|
32
|
+
console.error(`[DEBUG] ShogunConnector: Error initializing ShogunCore: ${error}`);
|
|
33
33
|
}
|
|
34
34
|
const setProvider = (provider) => {
|
|
35
35
|
var _a;
|