@farm.js/supabase 0.1.31 → 0.1.35
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.d.ts.map +1 -1
- package/dist/index.js +30 -30
- package/package.json +3 -3
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAsB,MAAM,eAAe,CAAC;AACvE,OAAO,EAGL,KAAK,6BAA6B,EAClC,KAAK,qBAAqB,EAC3B,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAsB,MAAM,eAAe,CAAC;AACvE,OAAO,EAGL,KAAK,6BAA6B,EAClC,KAAK,qBAAqB,EAC3B,MAAM,eAAe,CAAC;AAuCvB,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,yBAAyB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9E,MAAM,MAAM,gCAAgC,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;AAExF,MAAM,WAAW,kCAAkC;IACjD,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,OAAO,kBAAkB,CAAC;IACxC,OAAO,EAAE,gCAAgC,CAAC;CAC3C;AAED;;;;;GAKG;AACH,MAAM,MAAM,2BAA2B,GAAG,CACxC,OAAO,EAAE,kCAAkC,KACxC,yBAAyB,CAAC;AAE/B,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,2BAA2B,CAAC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,wBAAwB,CAAC;IACjC;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,GAAG,CAAC,EAAE,qBAAqB,CAAC;CAC7B;AAED,UAAU,mBAAmB;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,qBAAqB;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAiwBD,wBAAgB,QAAQ,CAAC,KAAK,GAAE,wBAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAuG7B,OAAO,WAAW,6BAA6B;;;;0BA+czC,OAAO,WAAW,6BAA6B;;mDAgDpF"}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createServerClient } from "@supabase/ssr";
|
|
|
2
2
|
import { defineIntegration, forwardIntegrationSetCookies, } from "@farm.js/core";
|
|
3
3
|
import { describeIntegrationOriginRejection, resolveIntegrationAllowedOrigins, validateIntegrationRequestOrigin, } from "@farm.js/core/integrations";
|
|
4
4
|
import { api as clientApi } from "@farm.js/core/client";
|
|
5
|
-
import { createPathInferredClientApi, createDocumentNavigationMatchers, escapeHtml, getOrigin, getReturnTo, integrationConfig, normalizeMatchers, parseCookieHeaderList, resolveAppPath, resolveCallbackSettings, toAbsoluteUrl, withSearchParams, } from "@farm.js/integration-utils";
|
|
5
|
+
import { createPathInferredClientApi, createDocumentNavigationMatchers, escapeHtml, getOrigin, createRequestCookie, getReturnTo, integrationConfig, normalizeMatchers, parseCookieHeaderList, resolveAppPath, resolveCallbackSettings, toAbsoluteUrl, withSearchParams, } from "@farm.js/integration-utils";
|
|
6
6
|
import { supabaseAuthFormFields, } from "./client.js";
|
|
7
7
|
function createSupabaseApi(input = {}) {
|
|
8
8
|
const loginPath = input.loginPath ?? "/auth/login";
|
|
@@ -56,35 +56,35 @@ function resolvePages(input) {
|
|
|
56
56
|
signUp: resolveAppPath(input.pages?.signUp, "Supabase integration pages.signUp"),
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
59
|
+
/**
|
|
60
|
+
* `@supabase/ssr` sets no `Secure` by default, so its session cookies would go
|
|
61
|
+
* out without it on https. `createRequestCookie` derives it from the request
|
|
62
|
+
* and applies the attributes browsers require for SameSite=None and the
|
|
63
|
+
* `__Host-` / `__Secure-` names. Supabase's own defaults still decide HttpOnly
|
|
64
|
+
* (off, so the browser client can read the session) and SameSite.
|
|
65
|
+
*/
|
|
66
|
+
function serializeCookie(name, value, request, options = {}) {
|
|
67
|
+
return createRequestCookie(name, value, request, {
|
|
68
|
+
maxAge: options.maxAge,
|
|
69
|
+
expires: options.expires,
|
|
70
|
+
domain: options.domain,
|
|
71
|
+
path: options.path,
|
|
72
|
+
secure: options.secure,
|
|
73
|
+
httpOnly: options.httpOnly === true,
|
|
74
|
+
sameSite: resolveSameSite(options.sameSite),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function resolveSameSite(sameSite) {
|
|
78
|
+
if (sameSite === true)
|
|
79
|
+
return "Strict";
|
|
80
|
+
switch (typeof sameSite === "string" ? sameSite.toLowerCase() : undefined) {
|
|
81
|
+
case "strict":
|
|
82
|
+
return "Strict";
|
|
83
|
+
case "none":
|
|
84
|
+
return "None";
|
|
85
|
+
default:
|
|
86
|
+
return "Lax";
|
|
86
87
|
}
|
|
87
|
-
return parts.join("; ");
|
|
88
88
|
}
|
|
89
89
|
function appendSetCookies(headers, cookies) {
|
|
90
90
|
for (const cookie of cookies) {
|
|
@@ -590,7 +590,7 @@ function createSupabaseHandler(context, env, instance) {
|
|
|
590
590
|
},
|
|
591
591
|
setAll(cookiesToSet) {
|
|
592
592
|
for (const cookie of cookiesToSet) {
|
|
593
|
-
setCookies.push(serializeCookie(cookie.name, cookie.value, cookie.options));
|
|
593
|
+
setCookies.push(serializeCookie(cookie.name, cookie.value, context.request, cookie.options));
|
|
594
594
|
}
|
|
595
595
|
},
|
|
596
596
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farm.js/supabase",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.35",
|
|
4
4
|
"description": "Supabase integration for Farm.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@supabase/ssr": "^0.9.0",
|
|
33
33
|
"@supabase/supabase-js": "^2.99.2",
|
|
34
|
-
"@farm.js/
|
|
35
|
-
"@farm.js/
|
|
34
|
+
"@farm.js/integration-utils": "0.1.35",
|
|
35
|
+
"@farm.js/core": "0.1.35"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc",
|