fix: "user" table writes use "updatedAt" not updated_at

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)
This commit is contained in:
lorentz 2026-05-10 23:03:36 -04:00
parent 041fb164e3
commit 3dd379de36
2 changed files with 2 additions and 2 deletions

View file

@ -23,7 +23,7 @@ export async function PATCH(request: NextRequest) {
} }
const result = await pool.query( 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`, RETURNING id, name, email`,
[name, session!.user.id] [name, session!.user.id]
); );

View file

@ -94,7 +94,7 @@ export async function userRequiresSetup(userId: string): Promise<boolean> {
export async function clearSetupFlag(userId: string): Promise<void> { export async function clearSetupFlag(userId: string): Promise<void> {
try { try {
await pool.query( 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] [userId]
); );
} catch (error) { } catch (error) {