@nauth-toolkit/client 0.1.102 → 0.1.104

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/index.cjs CHANGED
@@ -2133,7 +2133,9 @@ var NAuthClient = class {
2133
2133
  */
2134
2134
  async trustDevice() {
2135
2135
  const result = await this.post(this.config.endpoints.trustDevice, {}, true);
2136
- await this.setDeviceToken(result.deviceToken);
2136
+ if (this.config.tokenDelivery === "json" && result.deviceToken) {
2137
+ await this.setDeviceToken(result.deviceToken);
2138
+ }
2137
2139
  return result;
2138
2140
  }
2139
2141
  /**
@@ -2309,8 +2311,11 @@ var NAuthClient = class {
2309
2311
  this.currentUser = null;
2310
2312
  await this.tokenManager.clearTokens();
2311
2313
  await this.config.storage.removeItem(USER_KEY2);
2312
- if (forgetDevice && this.config.tokenDelivery === "json") {
2313
- await this.config.storage.removeItem(this.config.deviceTrust.storageKey);
2314
+ if (forgetDevice) {
2315
+ try {
2316
+ await this.config.storage.removeItem(this.config.deviceTrust.storageKey);
2317
+ } catch {
2318
+ }
2314
2319
  }
2315
2320
  try {
2316
2321
  await this.oauthStorage.removeItem(OAUTH_STATE_KEY2);