fix: resolve user dashboard field mapping and session consistency
Some checks failed
CI / Lint (push) Has been cancelled
CI / Test (push) Has been cancelled
CI / Build (push) Has been cancelled

Added JSON tags to the User struct to match frontend expectations and excluded sensitive fields.
Updated session management to include and persist DisplayName.
Unified user field names (using display_name) across backend, sessions, and frontend UI.
This commit is contained in:
2026-03-19 14:01:59 -04:00
parent 0ea2a3a985
commit 0f0486d8d4
4 changed files with 43 additions and 42 deletions

View File

@@ -244,13 +244,13 @@ type ModelConfig struct {
}
type User struct {
ID int `db:"id"`
Username string `db:"username"`
PasswordHash string `db:"password_hash"`
DisplayName *string `db:"display_name"`
Role string `db:"role"`
MustChangePassword bool `db:"must_change_password"`
CreatedAt time.Time `db:"created_at"`
ID int `db:"id" json:"id"`
Username string `db:"username" json:"username"`
PasswordHash string `db:"password_hash" json:"-"`
DisplayName *string `db:"display_name" json:"display_name"`
Role string `db:"role" json:"role"`
MustChangePassword bool `db:"must_change_password" json:"must_change_password"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
}
type ClientToken struct {