From 9c4673d9f1bfdd8c8be8a9930dae0dce518f19e5 Mon Sep 17 00:00:00 2001 From: 732642856 <732642856@qq.com> Date: Sat, 18 Jul 2026 12:29:34 +0800 Subject: [PATCH] fix: send account cookies when saving profile --- frontend/src/app/page.tsx | 1 + frontend/tests/profile-persistence.test.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/frontend/src/app/page.tsx b/frontend/src/app/page.tsx index 0d278c12..c3157a47 100644 --- a/frontend/src/app/page.tsx +++ b/frontend/src/app/page.tsx @@ -1322,6 +1322,7 @@ export default function Home() { const birthPlace = selectedBirthPlace(nextProfile); const response = await fetch("/api/account", { method: "PATCH", + credentials: "same-origin", headers: { "content-type": "application/json" }, body: JSON.stringify({ name: nextProfile.name.trim() || null, diff --git a/frontend/tests/profile-persistence.test.ts b/frontend/tests/profile-persistence.test.ts index ff4c1582..6694a689 100644 --- a/frontend/tests/profile-persistence.test.ts +++ b/frontend/tests/profile-persistence.test.ts @@ -5,6 +5,7 @@ import test from "node:test"; test("upserts a missing profile when saving account details", () => { const source = readFileSync(new URL("../src/app/page.tsx", import.meta.url), "utf8"); assert.match(source, /fetch\("\/api\/account",\s*\{\s*method:\s*"PATCH"/s); + assert.match(source, /credentials:\s*"same-origin"/); }); test("account route upserts profiles with the server admin client", () => {