diff --git a/server/internal/http/legacy/session.go b/server/internal/http/legacy/session.go index 0dda073b..fd361b88 100644 --- a/server/internal/http/legacy/session.go +++ b/server/internal/http/legacy/session.go @@ -31,10 +31,10 @@ type session struct { logger zerolog.Logger serverAddr string - id string - token string - profile types.MemberProfile - client *http.Client + id string + token string + name string + client *http.Client lastHostID string lockedControls bool @@ -154,7 +154,7 @@ func (s *session) create(username, password string) (string, error) { s.id = data.ID s.token = data.Token - s.profile = data.Profile + s.name = data.Profile.Name // if Cookie auth, the token will be empty if s.token == "" { diff --git a/server/internal/http/legacy/wstobackend.go b/server/internal/http/legacy/wstobackend.go index 1da99e5c..db0528f7 100644 --- a/server/internal/http/legacy/wstobackend.go +++ b/server/internal/http/legacy/wstobackend.go @@ -47,9 +47,11 @@ func (s *session) wsToBackend(msg []byte) error { } if request.DisplayName != "" { - s.profile.Name = request.DisplayName + s.name = request.DisplayName - err = s.apiReq(http.MethodPost, "/api/profile", s.profile, nil) + err = s.apiReq(http.MethodPost, "/api/profile", map[string]any{ + "name": request.DisplayName, + }, nil) if err != nil { return err } diff --git a/server/internal/http/legacy/wstoclient.go b/server/internal/http/legacy/wstoclient.go index f979bc49..b5a59ee8 100644 --- a/server/internal/http/legacy/wstoclient.go +++ b/server/internal/http/legacy/wstoclient.go @@ -422,7 +422,7 @@ func (s *session) wsToClient(msg []byte) error { return s.toClient(&oldMessage.SignalAnswer{ Event: oldEvent.SIGNAL_ANSWER, - DisplayName: s.profile.Name, // DisplayName + DisplayName: s.name, SDP: request.SDP, })