From 0527ff54b5ae70345fccb81209d7b21eefd04fed Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Tue, 18 Apr 2023 22:19:08 -0700 Subject: [PATCH] Display names for BareRTC --- pkg/controller/chat/chat.go | 2 ++ 1 file changed, 2 insertions(+) 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.