From d2883d1ce98c5f87721996359b14b5259e59c1dd Mon Sep 17 00:00:00 2001 From: wangsijie Date: Thu, 10 Oct 2024 19:48:41 +0800 Subject: [PATCH] fix(chore): remove colon in cookie key --- packages/next/edge/index.ts | 2 +- packages/next/server-actions/client.ts | 2 +- packages/next/src/index.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/next/edge/index.ts b/packages/next/edge/index.ts index 4efa7954..c28a70b9 100644 --- a/packages/next/edge/index.ts +++ b/packages/next/edge/index.ts @@ -114,7 +114,7 @@ export default class LogtoClient extends BaseClient { this.storage = new CookieStorage({ encryptionKey: this.config.cookieSecret, - cookieKey: `logto:${this.config.appId}`, + cookieKey: `logto_${this.config.appId}`, isSecure: this.config.cookieSecure, getCookie: (name) => { return cookies.get(name)?.value ?? ''; diff --git a/packages/next/server-actions/client.ts b/packages/next/server-actions/client.ts index 305a6a35..418ea782 100644 --- a/packages/next/server-actions/client.ts +++ b/packages/next/server-actions/client.ts @@ -106,7 +106,7 @@ export default class LogtoClient extends BaseClient { const { cookies } = await import('next/headers'); this.storage = new CookieStorage({ encryptionKey: this.config.cookieSecret, - cookieKey: `logto:${this.config.appId}`, + cookieKey: `_${this.config.appId}`, isSecure: this.config.cookieSecure, getCookie: (...args) => { return cookies().get(...args)?.value ?? ''; diff --git a/packages/next/src/index.ts b/packages/next/src/index.ts index 07d62a9e..f3c95cf3 100644 --- a/packages/next/src/index.ts +++ b/packages/next/src/index.ts @@ -205,7 +205,7 @@ export default class LogtoClient extends LogtoNextBaseClient { ): Promise { this.storage = new CookieStorage({ encryptionKey: this.config.cookieSecret, - cookieKey: `logto:${this.config.appId}`, + cookieKey: `logto_${this.config.appId}`, isSecure: this.config.cookieSecure, getCookie: (name) => { return request.cookies[name] ?? '';