@ai-matrx/auth 0.3.4 → 0.3.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog — @ai-matrx/auth
2
2
 
3
+ ## 0.3.5
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/auth/v0.3.4..npm/auth/v0.3.5 -- apps/shared/auth`).
7
+ No source changes intended and no consumer action required.
8
+
3
9
  ## 0.3.4
4
10
 
5
11
  Automatic changed-only republish (docs/metadata drift since the last tag — see
@@ -131,7 +131,7 @@ function personIdFromAccessToken(token) {
131
131
  expiresAtMs: typeof payload.exp === "number" ? payload.exp * 1e3 : null
132
132
  };
133
133
  }
134
- function extractErrorMessage(raw) {
134
+ function oauthErrorFromBody(raw) {
135
135
  try {
136
136
  const j = JSON.parse(raw);
137
137
  for (const key of ["error_description", "error_message", "msg", "error", "code"]) {
@@ -268,7 +268,7 @@ function createMatrxOAuth(config, ports) {
268
268
  };
269
269
  }
270
270
  const code = String(body["error"] ?? body["error_code"] ?? res.status);
271
- const detail = extractErrorMessage(text) ?? text.slice(0, 200);
271
+ const detail = oauthErrorFromBody(text) ?? text.slice(0, 200);
272
272
  if (isExchange) {
273
273
  throw new MatrxOAuthError("token_exchange_failed", `Token exchange failed (${res.status}): ${detail}`);
274
274
  }
@@ -97,7 +97,7 @@ function personIdFromAccessToken(token) {
97
97
  expiresAtMs: typeof payload.exp === "number" ? payload.exp * 1e3 : null
98
98
  };
99
99
  }
100
- function extractErrorMessage(raw) {
100
+ function oauthErrorFromBody(raw) {
101
101
  try {
102
102
  const j = JSON.parse(raw);
103
103
  for (const key of ["error_description", "error_message", "msg", "error", "code"]) {
@@ -234,7 +234,7 @@ function createMatrxOAuth(config, ports) {
234
234
  };
235
235
  }
236
236
  const code = String(body["error"] ?? body["error_code"] ?? res.status);
237
- const detail = extractErrorMessage(text) ?? text.slice(0, 200);
237
+ const detail = oauthErrorFromBody(text) ?? text.slice(0, 200);
238
238
  if (isExchange) {
239
239
  throw new MatrxOAuthError("token_exchange_failed", `Token exchange failed (${res.status}): ${detail}`);
240
240
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/auth",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "AI Matrx sign-in, session and organizations for every app: sign in/out, session storage and refresh per platform (browser, Next.js, extension, desktop, Node), the current person, their organizations and favourites, the one active organization (held requests, never a list filter), and the credentials @ai-matrx/data and @ai-matrx/api read.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -211,5 +211,5 @@
211
211
  "test": "vitest run",
212
212
  "verify:tarball": "node ./scripts/verify-tarball.mjs"
213
213
  },
214
- "gitHead": "d08db9b7b169f5c98fa59c9de985a367ba33c27f"
214
+ "gitHead": "6bf5dc0d5ee5a5071f767405726c136bf7f5ab69"
215
215
  }