@mastra/auth-workos 1.5.2 → 1.5.4

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,17 @@
1
1
  # @mastra/auth-workos
2
2
 
3
+ ## 1.5.3
4
+
5
+ ### Patch Changes
6
+
7
+ - dependencies updates: ([#16244](https://github.com/mastra-ai/mastra/pull/16244))
8
+ - Updated dependency [`@workos/authkit-session@^0.5.0` ↗︎](https://www.npmjs.com/package/@workos/authkit-session/v/0.5.0) (from `^0.3.4`, in `dependencies`)
9
+
10
+ - Fixed WorkOS session cookie support with the latest AuthKit session storage. ([#16244](https://github.com/mastra-ai/mastra/pull/16244))
11
+
12
+ - Updated dependencies [[`de66bb0`](https://github.com/mastra-ai/mastra/commit/de66bb040570444c702ce4d8e1e228a5de2949cb), [`67bf8e2`](https://github.com/mastra-ai/mastra/commit/67bf8e206dfe583954d96015cf0d09f7ac50e45f), [`8216d05`](https://github.com/mastra-ai/mastra/commit/8216d0528d866eb9a07f5d4c87ea3bb1e1139b45), [`d18b23c`](https://github.com/mastra-ai/mastra/commit/d18b23c5e29dfc381e73e3c51fcf6c779afd1823), [`5eb94eb`](https://github.com/mastra-ai/mastra/commit/5eb94ebcf66d4e28c9e26d5821ac93379bab20a0), [`1fa3e12`](https://github.com/mastra-ai/mastra/commit/1fa3e123582b63cfe49de4ee52dc6a065e8d956a), [`f9ee2ac`](https://github.com/mastra-ai/mastra/commit/f9ee2ac661af584e61bc063ac208c9035cd752ef), [`c853d53`](https://github.com/mastra-ai/mastra/commit/c853d535d2df84ab89db1adb4c28900c54c9a2d2), [`d8df1f8`](https://github.com/mastra-ai/mastra/commit/d8df1f8e947e1966c9d4e54713df56d0d0d65226), [`9192ddb`](https://github.com/mastra-ai/mastra/commit/9192ddbced8949113b30de444cbe763f075b59f5), [`ae96523`](https://github.com/mastra-ai/mastra/commit/ae965231f562d9766b0c90c49a69fc68acaa031c), [`17d5a92`](https://github.com/mastra-ai/mastra/commit/17d5a9211aa293b4d4418de3de70dc0394d58101), [`5573693`](https://github.com/mastra-ai/mastra/commit/5573693b589822250e20dfe6cf66e9ff3bc96da8), [`ec4da8a`](https://github.com/mastra-ai/mastra/commit/ec4da8a09e0d2ab452c6ee2c786042ea826b77e5), [`adc44e1`](https://github.com/mastra-ai/mastra/commit/adc44e13c7e570b91e86b20ea7556e61d819db31), [`ed346c0`](https://github.com/mastra-ai/mastra/commit/ed346c0bee2d8496690a4e538bfba1e46894660f), [`c9ce1b2`](https://github.com/mastra-ai/mastra/commit/c9ce1b28d10871110648f9d7b6d76e880b9fa999), [`3ef01fd`](https://github.com/mastra-ai/mastra/commit/3ef01fd130b53d5bd4f828beb174e516a2eb1158), [`245a9a3`](https://github.com/mastra-ai/mastra/commit/245a9a315705fce17ddd980f78a92504b6615c4a), [`dc0b611`](https://github.com/mastra-ai/mastra/commit/dc0b6119b769bd00ee2c5df9259fb376fe63077a), [`38b5de8`](https://github.com/mastra-ai/mastra/commit/38b5de8e5d1d41a69522addf53d96f4b3a1d5bf0), [`dc0b611`](https://github.com/mastra-ai/mastra/commit/dc0b6119b769bd00ee2c5df9259fb376fe63077a), [`dd6a66e`](https://github.com/mastra-ai/mastra/commit/dd6a66ea0b32e0dea8059aec6b35d151e2c87dc4), [`d785c59`](https://github.com/mastra-ai/mastra/commit/d785c593b67fcb4cdc4fab9fdbde5f3b7665efc0), [`1fa3e12`](https://github.com/mastra-ai/mastra/commit/1fa3e123582b63cfe49de4ee52dc6a065e8d956a), [`8b984f4`](https://github.com/mastra-ai/mastra/commit/8b984f4361c202270ceb69257185c4756c9a7c56), [`bf08402`](https://github.com/mastra-ai/mastra/commit/bf084022374fa5d06ca70ed67a86dd64e379071b), [`81fe587`](https://github.com/mastra-ai/mastra/commit/81fe587275035715c1720ddf3fee0505cf053036), [`1fa3e12`](https://github.com/mastra-ai/mastra/commit/1fa3e123582b63cfe49de4ee52dc6a065e8d956a), [`403c438`](https://github.com/mastra-ai/mastra/commit/403c438e417278989ce247233d2c465b8d902cdd), [`f8ba195`](https://github.com/mastra-ai/mastra/commit/f8ba1954e27ee2b20586cc6cd9cf13c002c232f2)]:
13
+ - @mastra/core@1.43.0
14
+
3
15
  ## 1.5.2
4
16
 
5
17
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -13,27 +13,28 @@ var WebSessionStorage = class extends authkitSession.CookieSessionStorage {
13
13
  super(config);
14
14
  }
15
15
  /**
16
- * Extract the encrypted session cookie from a Request.
16
+ * Extract a named cookie from a Request.
17
17
  *
18
18
  * @param request - Standard Web Request object
19
- * @returns The encrypted session string or null if not present
19
+ * @param name - Cookie name
20
+ * @returns The decoded cookie value or null if not present
20
21
  */
21
- async getSession(request) {
22
+ async getCookie(request, name) {
22
23
  const cookieHeader = request.headers.get("Cookie");
23
24
  if (!cookieHeader) {
24
25
  return null;
25
26
  }
26
27
  const cookies = cookieHeader.split(";").reduce(
27
28
  (acc, cookie) => {
28
- const [name, ...valueParts] = cookie.trim().split("=");
29
- if (name) {
30
- acc[name] = decodeURIComponent(valueParts.join("="));
29
+ const [cookieName, ...valueParts] = cookie.trim().split("=");
30
+ if (cookieName) {
31
+ acc[cookieName] = decodeURIComponent(valueParts.join("="));
31
32
  }
32
33
  return acc;
33
34
  },
34
35
  {}
35
36
  );
36
- return cookies[this.cookieName] || null;
37
+ return cookies[name] ?? null;
37
38
  }
38
39
  };
39
40