diff --git a/js/nostr/client.js b/js/nostr/client.js index c7ab8ab3..d4034dd9 100644 --- a/js/nostr/client.js +++ b/js/nostr/client.js @@ -1787,7 +1787,8 @@ export class NostrClient { } if (secret) { - if (!resultValue || resultValue !== secret) { + const normalizedResult = resultValue ? resultValue.toLowerCase() : ""; + if (resultValue !== secret && normalizedResult !== "ack") { return; } } @@ -2202,7 +2203,7 @@ export class NostrClient { message: error?.message || String(error), code: error?.code || null, }); - await client.destroy().catch(() => {}); + client.destroy(); this.nip46Client = null; if (!remember) { clearStoredNip46Session(); diff --git a/js/nostr/nip46Client.js b/js/nostr/nip46Client.js index 66d160e5..ba27fdbe 100644 --- a/js/nostr/nip46Client.js +++ b/js/nostr/nip46Client.js @@ -1823,7 +1823,10 @@ export class Nip46RpcClient { if (this.secret) { const normalizedResult = typeof result === "string" ? result.trim() : ""; - if (!normalizedResult || normalizedResult !== this.secret) { + if ( + !normalizedResult || + (normalizedResult !== this.secret && normalizedResult.toLowerCase() !== "ack") + ) { const error = new Error("Remote signer secret mismatch. Rejecting connection."); error.code = "nip46-secret-mismatch"; throw error;