@floatingpixels/supabase-nuxt 0.4.9 → 0.4.11
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/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -88,7 +88,11 @@ const module = defineNuxtModule({
|
|
|
88
88
|
extendViteConfig((config) => {
|
|
89
89
|
config.optimizeDeps = {
|
|
90
90
|
...config.optimizeDeps,
|
|
91
|
-
include: [
|
|
91
|
+
include: [
|
|
92
|
+
...config.optimizeDeps?.include || [],
|
|
93
|
+
"@floatingpixels/supabase-nuxt > @supabase/postgrest-js",
|
|
94
|
+
"@floatingpixels/supabase-nuxt > cookie"
|
|
95
|
+
]
|
|
92
96
|
};
|
|
93
97
|
});
|
|
94
98
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineNuxtPlugin, useRuntimeConfig, useRequestEvent } from "nuxt/app";
|
|
2
|
-
import { createServerClient
|
|
3
|
-
import { setCookie } from "h3";
|
|
2
|
+
import { createServerClient } from "@supabase/ssr";
|
|
3
|
+
import { setCookie, parseCookies } from "h3";
|
|
4
4
|
export default defineNuxtPlugin({
|
|
5
5
|
name: "supabase",
|
|
6
6
|
enforce: "pre",
|
|
@@ -13,13 +13,10 @@ export default defineNuxtPlugin({
|
|
|
13
13
|
const supabaseServerClient = createServerClient(url, anonKey, {
|
|
14
14
|
cookies: {
|
|
15
15
|
getAll: () => {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return parseCookieHeader(cookie_header).map((item) => ({
|
|
21
|
-
name: item.name,
|
|
22
|
-
value: item.value ?? ""
|
|
16
|
+
const cookie_records = parseCookies(event);
|
|
17
|
+
return Object.entries(cookie_records).map(([name, value]) => ({
|
|
18
|
+
name,
|
|
19
|
+
value
|
|
23
20
|
}));
|
|
24
21
|
},
|
|
25
22
|
setAll(cookiesToSet) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createServerClient
|
|
2
|
-
import { setCookie } from "h3";
|
|
1
|
+
import { createServerClient } from "@supabase/ssr";
|
|
2
|
+
import { setCookie, parseCookies } from "h3";
|
|
3
3
|
import { useRuntimeConfig } from "#imports";
|
|
4
4
|
export const supabaseServerClient = async (event) => {
|
|
5
5
|
const {
|
|
@@ -10,13 +10,10 @@ export const supabaseServerClient = async (event) => {
|
|
|
10
10
|
supabaseClient = createServerClient(url, anonKey, {
|
|
11
11
|
cookies: {
|
|
12
12
|
getAll: () => {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return parseCookieHeader(cookie_header).map((item) => ({
|
|
18
|
-
name: item.name,
|
|
19
|
-
value: item.value ?? ""
|
|
13
|
+
const cookie_records = parseCookies(event);
|
|
14
|
+
return Object.entries(cookie_records).map(([name, value]) => ({
|
|
15
|
+
name,
|
|
16
|
+
value
|
|
20
17
|
}));
|
|
21
18
|
},
|
|
22
19
|
setAll(cookiesToSet) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createServerClient
|
|
2
|
-
import { setCookie,
|
|
1
|
+
import { createServerClient } from "@supabase/ssr";
|
|
2
|
+
import { setCookie, parseCookies } from "h3";
|
|
3
3
|
import { useRuntimeConfig } from "#imports";
|
|
4
4
|
export const supabaseServiceRole = async (event) => {
|
|
5
5
|
const {
|
|
@@ -16,13 +16,10 @@ export const supabaseServiceRole = async (event) => {
|
|
|
16
16
|
supabaseClient = createServerClient(url, serviceRoleKey, {
|
|
17
17
|
cookies: {
|
|
18
18
|
getAll: () => {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return parseCookieHeader(cookie_header).map((item) => ({
|
|
24
|
-
name: item.name,
|
|
25
|
-
value: item.value ?? ""
|
|
19
|
+
const cookie_records = parseCookies(event);
|
|
20
|
+
return Object.entries(cookie_records).map(([name, value]) => ({
|
|
21
|
+
name,
|
|
22
|
+
value
|
|
26
23
|
}));
|
|
27
24
|
},
|
|
28
25
|
setAll(cookiesToSet) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@floatingpixels/supabase-nuxt",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.11",
|
|
4
4
|
"description": "Supabase module for Nuxt",
|
|
5
5
|
"repository": "floatingpixels/supabase-nuxt",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,7 +59,8 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@supabase/ssr": "^0.6.1",
|
|
62
|
-
"@supabase/supabase-js": "^2.49.4"
|
|
62
|
+
"@supabase/supabase-js": "^2.49.4",
|
|
63
|
+
"cookie": "^1.0.2"
|
|
63
64
|
},
|
|
64
65
|
"devDependencies": {
|
|
65
66
|
"@nuxt/devtools": "^2.3.2",
|