From 6e7860495753e6362f7c951a0641e854cecdddb9 Mon Sep 17 00:00:00 2001 From: Saiful Alom Date: Wed, 17 Jun 2026 12:03:28 +0600 Subject: [PATCH] fix(auth): drop explicit cookie domain to resolve edge deployment drops - Remove explicit `domain` assignment from the `auth_token` cookie configuration - Allow the browser to fall back to default host origin matching for the custom domain - Restore the `maxAge` explanatory comment string for structural readability --- src/modules/auth/auth.actions.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modules/auth/auth.actions.ts b/src/modules/auth/auth.actions.ts index 20982a2..6376393 100644 --- a/src/modules/auth/auth.actions.ts +++ b/src/modules/auth/auth.actions.ts @@ -1,3 +1,4 @@ +// src/modules/auth/auth.actions.ts import { defineAction, ActionError } from 'astro:actions'; import { SignJWT } from 'jose'; import { loginSchema } from './auth.schema'; @@ -11,7 +12,6 @@ export const login = defineAction({ // 1. Validate Credentials against Environment Secrets if (email !== env.ADMIN_EMAIL || password !== env.ADMIN_PASSWORD) { - // High security, standard code format for authentication blocks throw new ActionError({ code: "UNAUTHORIZED", message: "Invalid email or password." @@ -34,8 +34,7 @@ export const login = defineAction({ httpOnly: true, secure: true, sameSite: 'lax', - domain: context.url.hostname, - maxAge: 60 * 60 * 24, + maxAge: 60 * 60 * 24, // 24 hours }); return { success: true };