jazz-tools 0.10.13 → 0.10.14

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > jazz-tools@0.10.13 build /home/runner/_work/jazz/jazz/packages/jazz-tools
2
+ > jazz-tools@0.10.14 build /home/runner/_work/jazz/jazz/packages/jazz-tools
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
@@ -11,8 +11,8 @@
11
11
  ESM Build start
12
12
  ESM dist/index.js 1.50 KB
13
13
  ESM dist/testing.js 6.28 KB
14
- ESM dist/chunk-GSIV52ZH.js 115.71 KB
14
+ ESM dist/chunk-5YDDEUNX.js 115.67 KB
15
15
  ESM dist/index.js.map 259.00 B
16
16
  ESM dist/testing.js.map 12.41 KB
17
- ESM dist/chunk-GSIV52ZH.js.map 276.19 KB
18
- ESM ⚡️ Build success in 92ms
17
+ ESM dist/chunk-5YDDEUNX.js.map 275.90 KB
18
+ ESM ⚡️ Build success in 38ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # jazz-tools
2
2
 
3
+ ## 0.10.14
4
+
5
+ ### Patch Changes
6
+
7
+ - 75211e3: Fixes invalid authentication state when logging out after signUp
8
+
3
9
  ## 0.10.13
4
10
 
5
11
  ### Patch Changes
@@ -545,7 +545,7 @@ async function createJazzContext(options) {
545
545
  AccountSchema: options.AccountSchema,
546
546
  sessionProvider: options.sessionProvider,
547
547
  onLogOut: () => {
548
- authSecretStorage.clear();
548
+ authSecretStorage.clearWithoutNotify();
549
549
  }
550
550
  });
551
551
  } else {
@@ -561,11 +561,11 @@ async function createJazzContext(options) {
561
561
  crypto,
562
562
  AccountSchema: options.AccountSchema,
563
563
  onLogOut: async () => {
564
- await authSecretStorage.clear();
564
+ await authSecretStorage.clearWithoutNotify();
565
565
  }
566
566
  });
567
567
  if (!options.newAccountProps) {
568
- await authSecretStorage.set({
568
+ await authSecretStorage.setWithoutNotify({
569
569
  accountID: context.account.id,
570
570
  secretSeed,
571
571
  accountSecret: context.node.account.agentSecret,
@@ -3457,7 +3457,6 @@ var KvStoreContext_default = KvStoreContext;
3457
3457
  var STORAGE_KEY = "jazz-logged-in-secret";
3458
3458
  var AuthSecretStorage = class {
3459
3459
  constructor() {
3460
- this.notify = false;
3461
3460
  this.listeners = /* @__PURE__ */ new Set();
3462
3461
  this.isAuthenticated = false;
3463
3462
  }
@@ -3522,7 +3521,7 @@ var AuthSecretStorage = class {
3522
3521
  provider: parsed.provider
3523
3522
  };
3524
3523
  }
3525
- async set(payload) {
3524
+ async setWithoutNotify(payload) {
3526
3525
  const kvStore = KvStoreContext_default.getInstance().getStorage();
3527
3526
  await kvStore.set(
3528
3527
  STORAGE_KEY,
@@ -3533,9 +3532,10 @@ var AuthSecretStorage = class {
3533
3532
  provider: payload.provider
3534
3533
  })
3535
3534
  );
3536
- if (this.notify) {
3537
- this.emitUpdate(payload);
3538
- }
3535
+ }
3536
+ async set(payload) {
3537
+ this.setWithoutNotify(payload);
3538
+ this.emitUpdate(payload);
3539
3539
  }
3540
3540
  getIsAuthenticated(data) {
3541
3541
  if (!data) return false;
@@ -3555,12 +3555,13 @@ var AuthSecretStorage = class {
3555
3555
  listener(this.isAuthenticated);
3556
3556
  }
3557
3557
  }
3558
- async clear() {
3558
+ async clearWithoutNotify() {
3559
3559
  const kvStore = KvStoreContext_default.getInstance().getStorage();
3560
3560
  await kvStore.delete(STORAGE_KEY);
3561
- if (this.notify) {
3562
- this.emitUpdate(null);
3563
- }
3561
+ }
3562
+ async clear() {
3563
+ await this.clearWithoutNotify();
3564
+ this.emitUpdate(null);
3564
3565
  }
3565
3566
  };
3566
3567
 
@@ -3590,10 +3591,6 @@ import { cojsonInternals as cojsonInternals4 } from "cojson";
3590
3591
  var JazzContextManager = class {
3591
3592
  constructor() {
3592
3593
  this.authSecretStorage = new AuthSecretStorage();
3593
- this.authSecretStorageWithNotify = Object.assign(
3594
- Object.create(this.authSecretStorage),
3595
- { notify: true }
3596
- );
3597
3594
  this.authenticating = false;
3598
3595
  this.logOut = async () => {
3599
3596
  if (!this.context || !this.props) {
@@ -3696,7 +3693,7 @@ var JazzContextManager = class {
3696
3693
  return this.value;
3697
3694
  }
3698
3695
  getAuthSecretStorage() {
3699
- return this.authSecretStorageWithNotify;
3696
+ return this.authSecretStorage;
3700
3697
  }
3701
3698
  async handleAnonymousAccountMigration(prevContext) {
3702
3699
  if (!this.props) {
@@ -4048,4 +4045,4 @@ export {
4048
4045
  consumeInviteLink
4049
4046
  };
4050
4047
  /* istanbul ignore file -- @preserve */
4051
- //# sourceMappingURL=chunk-GSIV52ZH.js.map
4048
+ //# sourceMappingURL=chunk-5YDDEUNX.js.map