@aithos/sdk 0.1.0-alpha.11 → 0.1.0-alpha.12

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.
Files changed (2) hide show
  1. package/dist/src/auth.js +9 -1
  2. package/package.json +1 -1
package/dist/src/auth.js CHANGED
@@ -479,8 +479,16 @@ export class AithosAuth {
479
479
  }
480
480
  if (!code)
481
481
  return null;
482
- const session = await this.exchange(code);
482
+ // Strip the aithos_code from the URL SYNCHRONOUSLY, before any
483
+ // await. React StrictMode (dev) invokes effects twice — without
484
+ // this, the first call awaits exchange (microtask, code still in
485
+ // the URL), the second invocation reads the same code and POSTs
486
+ // again, hitting `auth_code_consumed: aithos_code expired or
487
+ // already used`. Cleaning before the await makes the second
488
+ // invocation read a clean URL and return null without a network
489
+ // round-trip.
483
490
  cleanCallbackParams(this.#win, here);
491
+ const session = await this.exchange(code);
484
492
  // Hydrate signers if the SSO response carried an enc_key (Google flow
485
493
  // gives us the AES-GCM key in plaintext, encrypted only in transit
486
494
  // by TLS — see auth.aithos.be design doc).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aithos/sdk",
3
- "version": "0.1.0-alpha.11",
3
+ "version": "0.1.0-alpha.12",
4
4
  "description": "Aithos SDK — high-level TypeScript developer kit for building agentic apps on the Aithos protocol. Wraps @aithos/protocol-client and exposes the Aithos compute proxy and wallet (Stripe top-up) endpoints.",
5
5
  "keywords": [
6
6
  "aithos",