From c8a121dd70291bf12cff533b992ff9cee4906ee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fukan=20Akkaya?= Date: Thu, 26 Oct 2023 13:06:55 +0300 Subject: [PATCH] fix: include cookieOptions for deleteCookie (#651) --- .changeset/empty-carrots-learn.md | 5 +++++ packages/nextjs/src/routeHandlerClient.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/empty-carrots-learn.md diff --git a/.changeset/empty-carrots-learn.md b/.changeset/empty-carrots-learn.md new file mode 100644 index 00000000..444de374 --- /dev/null +++ b/.changeset/empty-carrots-learn.md @@ -0,0 +1,5 @@ +--- +'@supabase/auth-helpers-nextjs': patch +--- + +include cookie options for deleteCookie diff --git a/packages/nextjs/src/routeHandlerClient.ts b/packages/nextjs/src/routeHandlerClient.ts index 30b96bec..696ecab9 100644 --- a/packages/nextjs/src/routeHandlerClient.ts +++ b/packages/nextjs/src/routeHandlerClient.ts @@ -31,6 +31,7 @@ class NextRouteHandlerAuthStorageAdapter extends CookieAuthStorageAdapter { protected deleteCookie(name: string): void { const nextCookies = this.context.cookies(); nextCookies.set(name, '', { + ...this.cookieOptions, maxAge: 0 }); }