From 3ad482351bb2c8095f0eb9eb5ff26c18c45b97c7 Mon Sep 17 00:00:00 2001 From: DarkSky <25152247+darkskygit@users.noreply.github.com> Date: Tue, 10 Feb 2026 16:18:22 +0800 Subject: [PATCH] fix: server init (#14412) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### PR Dependency Tree * **PR #14412** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) ## Summary by CodeRabbit * **Refactor** * Improved internal code organization for better maintainability. --- packages/backend/server/src/core/auth/service.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/backend/server/src/core/auth/service.ts b/packages/backend/server/src/core/auth/service.ts index 87d1223a0a..7d9decfcca 100644 --- a/packages/backend/server/src/core/auth/service.ts +++ b/packages/backend/server/src/core/auth/service.ts @@ -37,12 +37,7 @@ function extractTokenFromHeader(authorization: string) { @Injectable() export class AuthService implements OnApplicationBootstrap { - readonly cookieOptions: CookieOptions = { - sameSite: 'lax', - httpOnly: true, - path: '/', - secure: this.config.server.https, - }; + readonly cookieOptions: CookieOptions; static readonly sessionCookieName = 'affine_session'; static readonly userCookieName = 'affine_user_id'; static readonly csrfCookieName = 'affine_csrf_token'; @@ -51,7 +46,14 @@ export class AuthService implements OnApplicationBootstrap { private readonly config: Config, private readonly models: Models, private readonly mailer: Mailer - ) {} + ) { + this.cookieOptions = { + sameSite: 'lax', + httpOnly: true, + path: '/', + secure: this.config.server.https, + }; + } async onApplicationBootstrap() { if (env.dev) {