applesauce-signers 0.0.0-next-20250828144630 → 0.0.0-next-20250828145754

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.
@@ -251,9 +251,12 @@ export class NostrConnectProvider {
251
251
  const providerPubkey = await this.signer.getPublicKey();
252
252
  if (target !== providerPubkey)
253
253
  throw new Error("Invalid target pubkey");
254
- // If a secret is set, check that if matches
255
- if (this.secret && this.secret !== secret)
256
- throw new Error("Invalid secret");
254
+ // If the client is already known, ensure that it matches the new client
255
+ if (this.client && this.client !== client)
256
+ throw new Error("Only one client can connect at a time");
257
+ // If this is the first `connect` request, check that the secret matches
258
+ if (this.secret && !this.client && this.secret !== secret)
259
+ throw new Error("Invalid connection secret");
257
260
  // Handle authorization if callback is provided
258
261
  if (this.onConnect) {
259
262
  const authorized = await this.onConnect(client, permissions);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "applesauce-signers",
3
- "version": "0.0.0-next-20250828144630",
3
+ "version": "0.0.0-next-20250828145754",
4
4
  "description": "Signer classes for applesauce",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -38,7 +38,7 @@
38
38
  "@noble/hashes": "^1.7.1",
39
39
  "@noble/secp256k1": "^1.7.1",
40
40
  "@scure/base": "^1.2.4",
41
- "applesauce-core": "0.0.0-next-20250828144630",
41
+ "applesauce-core": "0.0.0-next-20250828145754",
42
42
  "debug": "^4.4.0",
43
43
  "nanoid": "^5.0.9",
44
44
  "nostr-tools": "~2.15",