@mastra/auth-workos 1.5.2 → 1.5.5-alpha.0
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 +22 -0
- package/dist/index.cjs +8 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/session-storage.d.ts +4 -3
- package/dist/session-storage.d.ts.map +1 -1
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -11,27 +11,28 @@ var WebSessionStorage = class extends CookieSessionStorage {
|
|
|
11
11
|
super(config);
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Extract
|
|
14
|
+
* Extract a named cookie from a Request.
|
|
15
15
|
*
|
|
16
16
|
* @param request - Standard Web Request object
|
|
17
|
-
* @
|
|
17
|
+
* @param name - Cookie name
|
|
18
|
+
* @returns The decoded cookie value or null if not present
|
|
18
19
|
*/
|
|
19
|
-
async
|
|
20
|
+
async getCookie(request, name) {
|
|
20
21
|
const cookieHeader = request.headers.get("Cookie");
|
|
21
22
|
if (!cookieHeader) {
|
|
22
23
|
return null;
|
|
23
24
|
}
|
|
24
25
|
const cookies = cookieHeader.split(";").reduce(
|
|
25
26
|
(acc, cookie) => {
|
|
26
|
-
const [
|
|
27
|
-
if (
|
|
28
|
-
acc[
|
|
27
|
+
const [cookieName, ...valueParts] = cookie.trim().split("=");
|
|
28
|
+
if (cookieName) {
|
|
29
|
+
acc[cookieName] = decodeURIComponent(valueParts.join("="));
|
|
29
30
|
}
|
|
30
31
|
return acc;
|
|
31
32
|
},
|
|
32
33
|
{}
|
|
33
34
|
);
|
|
34
|
-
return cookies[
|
|
35
|
+
return cookies[name] ?? null;
|
|
35
36
|
}
|
|
36
37
|
};
|
|
37
38
|
|