Add account management page

Add a new /web/account page, reachable by clicking the username in
the nav, with two forms: updating display name/email, and changing
the password (requires the current password, min 8 chars, confirm
match). Add db.SetProfile to persist display name/email.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-08-21 06:32:18 +02:00
co-authored by Copilot
parent 1c039e6396
commit 8b10386c91
9 changed files with 527 additions and 5 deletions
+11
View File
@@ -80,6 +80,17 @@ func (d *DB) SetPassword(username, password string) error {
return requireRowsAffected(res, ErrUserNotFound)
}
// SetProfile updates username's display name and email address. Returns
// ErrUserNotFound if the user doesn't exist.
func (d *DB) SetProfile(username, displayName, email string) error {
res, err := d.conn.Exec(`UPDATE users SET display_name = ?, email = ? WHERE username = ?`, displayName, email, username)
if err != nil {
return fmt.Errorf("setting profile: %w", err)
}
return requireRowsAffected(res, ErrUserNotFound)
}
// DeleteUser removes username along with all of its calendars, address
// books, and sharing grants (calendars/addressbooks cascade via foreign
// key; shares are cleaned up explicitly since they reference usernames as