diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts index 1429e39..73d456d 100644 --- a/src/auth/auth.service.ts +++ b/src/auth/auth.service.ts @@ -129,7 +129,7 @@ export class AuthService { secure: isProduction || cookieSecure, sameSite: "none" as const, path: isRefreshToken ? "/auth/refresh" : "/", - domain: domain, + domain: domain?.startsWith(".") ? domain : `.${domain}`, maxAge: isRefreshToken ? 7 * 24 * 60 * 60 * 1000 : 15 * 60 * 1000, }; }