diff --git a/pkg/controller/chat/chat.go b/pkg/controller/chat/chat.go index d7b4135..adf0e9d 100644 --- a/pkg/controller/chat/chat.go +++ b/pkg/controller/chat/chat.go @@ -20,6 +20,7 @@ type Claims struct { IsAdmin bool `json:"op"` Avatar string `json:"img"` ProfileURL string `json:"url"` + Nickname string `json:"nick"` // Standard claims. Notes: // subject = username @@ -79,6 +80,7 @@ func Landing() http.HandlerFunc { IsAdmin: currentUser.IsAdmin, Avatar: avatar, ProfileURL: "/u/" + currentUser.Username, + Nickname: currentUser.NameOrUsername(), RegisteredClaims: jwt.RegisteredClaims{ // TODO: ExpiresAt 60 minutes to work around chat server reliability, // should be shorter like 5 minutes.