set human name in livekit room context
This commit is contained in:
@@ -1064,6 +1064,11 @@ func (h *Handler) GetLivekitToken(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, "unauthorized", http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
humanEmail, ok := middleware.EmailFromContext(r.Context())
|
||||
if !ok {
|
||||
http.Error(w, "unauthorized", http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
|
||||
var req GetLivekitTokenRequest
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
@@ -1076,7 +1081,7 @@ func (h *Handler) GetLivekitToken(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
token, err := h.livekitClient.GetJoinToken(req.RoomId, humanId)
|
||||
token, err := h.livekitClient.GetJoinToken(req.RoomId, humanId, humanEmail)
|
||||
if err != nil {
|
||||
slog.Error("failed to generate livekit token", "error", err, "humanId", humanId, "roomId", req.RoomId)
|
||||
http.Error(w, "failed to generate token", http.StatusInternalServerError)
|
||||
|
||||
Reference in New Issue
Block a user