From 3dd379de36b48ab4e8de900ddd72c959418b1197 Mon Sep 17 00:00:00 2001 From: lorentz Date: Sun, 10 May 2026 23:03:36 -0400 Subject: [PATCH] fix: "user" table writes use "updatedAt" not updated_at MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two more sites with the same bug as the theme route — Better Auth's "user" table column is quoted camelCase. Caught via UAT after the theme PUT fix. - app/api/settings/profile/route.ts:26 (PATCH admin profile name) - lib/bootstrap.ts:97 (clearSetupFlag — first-login setup wizard) --- app/api/settings/profile/route.ts | 2 +- lib/bootstrap.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/api/settings/profile/route.ts b/app/api/settings/profile/route.ts index a12eba7..5288ef3 100644 --- a/app/api/settings/profile/route.ts +++ b/app/api/settings/profile/route.ts @@ -23,7 +23,7 @@ export async function PATCH(request: NextRequest) { } const result = await pool.query( - `UPDATE "user" SET name = $1, updated_at = NOW() WHERE id = $2 + `UPDATE "user" SET name = $1, "updatedAt" = NOW() WHERE id = $2 RETURNING id, name, email`, [name, session!.user.id] ); diff --git a/lib/bootstrap.ts b/lib/bootstrap.ts index 13955aa..8fd3e95 100644 --- a/lib/bootstrap.ts +++ b/lib/bootstrap.ts @@ -94,7 +94,7 @@ export async function userRequiresSetup(userId: string): Promise { export async function clearSetupFlag(userId: string): Promise { try { await pool.query( - 'UPDATE "user" SET requires_setup = false, updated_at = NOW() WHERE id = $1', + 'UPDATE "user" SET requires_setup = false, "updatedAt" = NOW() WHERE id = $1', [userId] ); } catch (error) {