diff --git a/VERSION b/VERSION index 166c9e2..3d9dcb1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.25.2 +0.25.3 diff --git a/server/pages/pages.go b/server/pages/pages.go index 1fa1d55..6ad0166 100644 --- a/server/pages/pages.go +++ b/server/pages/pages.go @@ -514,16 +514,30 @@ func (e *Engine) RenderWorkflow() gin.HandlerFunc { } } -// getUserContext extracts user info from gin context (set by auth middleware). +// getUserContext extracts user info from gin context (set by auth middleware) +// and enriches it with display name, username, and email from the database. func (e *Engine) getUserContext(c *gin.Context) *UserContext { userID, exists := c.Get("user_id") if !exists { return nil } - return &UserContext{ - ID: userID.(string), - Role: c.GetString("role"), + uid := userID.(string) + uc := &UserContext{ + ID: uid, + Email: c.GetString("email"), + Role: c.GetString("role"), } + // Enrich from DB — username, display_name, and email may not be in JWT claims. + if e.stores.Users != nil { + if u, err := e.stores.Users.GetByID(c.Request.Context(), uid); err == nil && u != nil { + uc.Username = u.Username + uc.DisplayName = u.DisplayName + if uc.Email == "" { + uc.Email = u.Email + } + } + } + return uc } // loadBanner reads banner config from global settings. diff --git a/server/pages/templates/base.html b/server/pages/templates/base.html index 1c74c01..e39d0af 100644 --- a/server/pages/templates/base.html +++ b/server/pages/templates/base.html @@ -34,16 +34,18 @@ .surface { height: var(--surface-h); overflow: hidden; } .banner { flex-shrink: 0; } - + @@ -104,6 +106,14 @@ + {{/* ── Universal init: theme + appearance for ALL surfaces ── */}} + + {{if eq .Surface "chat"}}{{template "scripts-chat" .}}{{end}} {{if eq .Surface "admin"}}{{template "scripts-admin" .}}{{end}} {{if eq .Surface "editor"}}{{template "scripts-editor" .}}{{end}} @@ -112,7 +122,7 @@ {{/* ── Debug Log Modal (all surfaces) ───── */}}