Fix TypeScript implicit any error on setAll cookie parameter

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
David Kiania 2026-04-16 16:30:43 +03:00
parent 5034835bf9
commit 0c7abd50f2
2 changed files with 4 additions and 4 deletions

View file

@ -1,4 +1,4 @@
import { createServerClient } from "@supabase/ssr";
import { createServerClient, type SetAllCookies } from "@supabase/ssr";
import { cookies } from "next/headers";
export async function createClient() {
@ -12,7 +12,7 @@ export async function createClient() {
getAll() {
return cookieStore.getAll();
},
setAll(cookiesToSet) {
setAll(cookiesToSet: Parameters<SetAllCookies>[0]) {
try {
cookiesToSet.forEach(({ name, value, options }) =>
cookieStore.set(name, value, options)

View file

@ -1,4 +1,4 @@
import { createServerClient } from "@supabase/ssr";
import { createServerClient, type SetAllCookies } from "@supabase/ssr";
import { NextResponse, type NextRequest } from "next/server";
export async function middleware(request: NextRequest) {
@ -12,7 +12,7 @@ export async function middleware(request: NextRequest) {
getAll() {
return request.cookies.getAll();
},
setAll(cookiesToSet) {
setAll(cookiesToSet: Parameters<SetAllCookies>[0]) {
cookiesToSet.forEach(({ name, value }) =>
request.cookies.set(name, value)
);