B1: React Query deeper adoption (P1–P3) #86

Closed
null wants to merge 340 commits from branch/b1-react-query into main
1 changed files with 3 additions and 2 deletions
Showing only changes of commit 12bcd1d8f3 - Show all commits

View File

@ -707,11 +707,12 @@ async function findOrProvisionUser(claims, config) {
throw Object.assign(new Error('This account is inactive.'), { status: 403 });
}
// Refresh login timestamp and display name from provider claims
// Refresh login timestamp; only seed display_name from provider on first login
// (display_name IS NULL). Once the user has set one manually, preserve it.
db.prepare(`
UPDATE users
SET last_login_at = datetime('now'),
display_name = COALESCE(?, display_name),
display_name = CASE WHEN display_name IS NULL THEN ? ELSE display_name END,
updated_at = datetime('now')
WHERE id = ?
`).run(claims.name || null, user.id);