From a0962a01998bb89cd189405e296edec909bd03d0 Mon Sep 17 00:00:00 2001 From: kejun Date: Wed, 15 Mar 2023 23:27:22 +0800 Subject: [PATCH] fix: try fix netlify auth login --- server/api/auth/[...].ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/api/auth/[...].ts b/server/api/auth/[...].ts index e189ed3..497d218 100644 --- a/server/api/auth/[...].ts +++ b/server/api/auth/[...].ts @@ -16,9 +16,10 @@ const nuxtAuthHandler = NuxtAuthHandler({ }); export default defineEventHandler(async (event) => { const result = await nuxtAuthHandler(event); - const setCookie = event.node.res.getHeader("set-cookie") - console.log('start---------') - console.log(setCookie); - console.log('end---------') + const headerCookies = event.node.res.getHeader("set-cookie"); + if (headerCookies && typeof headerCookies === "string") { + event.node.res.removeHeader("set-cookie"); + event.node.res.setHeader("set-cookie", headerCookies.split(/,(?!\s)/)); + } return result; });