@spacelr/sdk 0.8.0 → 0.8.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.mjs CHANGED
@@ -115,7 +115,7 @@ var HttpClient = class {
115
115
  });
116
116
  const responseBody = await this.parseResponse(response);
117
117
  if (!response.ok) {
118
- if (options.authenticated && response.status === 401) {
118
+ if (options.authenticated && response.status === 401 && !options.skipAuthRefresh) {
119
119
  if (await this.recoverFromAuthFailure(isRetry)) {
120
120
  return this.requestWithRetry(options, true);
121
121
  }
@@ -1395,7 +1395,11 @@ var AuthModule = class {
1395
1395
  await this.http.request({
1396
1396
  method: "POST",
1397
1397
  path: "/auth/logout",
1398
- authenticated: true
1398
+ authenticated: true,
1399
+ // A 401 here means the session is already gone — do not trigger the
1400
+ // refresh/auth-lost recovery, or an auth-lost handler that calls
1401
+ // logout would recurse into an endless 401 loop.
1402
+ skipAuthRefresh: true
1399
1403
  });
1400
1404
  } catch {
1401
1405
  }