@spacelr/sdk 0.2.0 → 0.2.1

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.js CHANGED
@@ -412,7 +412,9 @@ var TokenManager = class {
412
412
  return tokens.accessToken;
413
413
  }
414
414
  async setTokens(tokens) {
415
- await this.storage.setTokens(tokens);
415
+ const needsDefault = tokens.expiresAt === void 0 && !!tokens.refreshToken;
416
+ const normalised = needsDefault ? { ...tokens, expiresAt: Math.floor(Date.now() / 1e3) } : tokens;
417
+ await this.storage.setTokens(normalised);
416
418
  this.authLostEmitted = false;
417
419
  }
418
420
  async clearTokens() {