mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
chore: changes...
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { createServerClient } from "@supabase/ssr";
|
||||
import { NextResponse, type NextRequest } from "next/server";
|
||||
import { isAdminPage, isProtectedPage } from "./helpers";
|
||||
import { getCookieSettings, isAdminPage, isProtectedPage } from "./helpers";
|
||||
|
||||
export async function updateSession(request: NextRequest) {
|
||||
let supabaseResponse = NextResponse.next({
|
||||
@@ -33,7 +33,10 @@ export async function updateSession(request: NextRequest) {
|
||||
request,
|
||||
});
|
||||
cookiesToSet.forEach(({ name, value, options }) => {
|
||||
supabaseResponse.cookies.set(name, value, options);
|
||||
supabaseResponse.cookies.set(name, value, {
|
||||
...options,
|
||||
...getCookieSettings(),
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { createServerClient, type CookieOptions } from "@supabase/ssr";
|
||||
import { getCookieSettings } from "../helpers";
|
||||
|
||||
type Cookies = { name: string; value: string; options?: CookieOptions }[];
|
||||
|
||||
@@ -20,7 +21,10 @@ export async function getServerSupabase() {
|
||||
setAll(cookiesToSet: Cookies) {
|
||||
try {
|
||||
cookiesToSet.forEach(({ name, value, options }) => {
|
||||
cookieStore.set(name, value, options);
|
||||
cookieStore.set(name, value, {
|
||||
...options,
|
||||
...getCookieSettings(),
|
||||
});
|
||||
});
|
||||
} catch {
|
||||
// The `setAll` method was called from a Server Component.
|
||||
|
||||
Reference in New Issue
Block a user