fix: send account cookies when saving profile

This commit is contained in:
732642856
2026-07-18 12:29:34 +08:00
parent 60a9e3a58f
commit 9c4673d9f1
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -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,
@@ -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", () => {