Identity cannot be empty (#580)
This commit is contained in:
@@ -5,12 +5,13 @@ import "errors"
|
||||
var (
|
||||
ErrEgressNotFound = errors.New("egress does not exist")
|
||||
ErrEgressNotConnected = errors.New("egress not connected (redis required)")
|
||||
ErrIdentityEmpty = errors.New("identity cannot be empty")
|
||||
ErrMetadataExceedsLimits = errors.New("metadata size exceeds limits")
|
||||
ErrOperationFailed = errors.New("operation cannot be completed")
|
||||
ErrParticipantNotFound = errors.New("participant does not exist")
|
||||
ErrRoomNotFound = errors.New("requested room does not exist")
|
||||
ErrRoomLockFailed = errors.New("could not lock room")
|
||||
ErrRoomUnlockFailed = errors.New("could not unlock room, lock token does not match")
|
||||
ErrParticipantNotFound = errors.New("participant does not exist")
|
||||
ErrTrackNotFound = errors.New("track is not found")
|
||||
ErrWebHookMissingAPIKey = errors.New("api_key is required to use webhooks")
|
||||
ErrOperationFailed = errors.New("operation cannot be completed")
|
||||
ErrMetadataExceedsLimits = errors.New("metadata size exceeds limits")
|
||||
)
|
||||
|
||||
@@ -11,9 +11,10 @@ import (
|
||||
"github.com/sebest/xff"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/ua-parser/uap-go/uaparser"
|
||||
|
||||
"github.com/livekit/protocol/livekit"
|
||||
"github.com/livekit/protocol/logger"
|
||||
"github.com/ua-parser/uap-go/uaparser"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/config"
|
||||
"github.com/livekit/livekit-server/pkg/routing"
|
||||
@@ -84,6 +85,10 @@ func (s *RTCService) validate(r *http.Request) (livekit.RoomName, routing.Partic
|
||||
return "", routing.ParticipantInit{}, http.StatusUnauthorized, err
|
||||
}
|
||||
|
||||
if claims.Identity == "" {
|
||||
return "", routing.ParticipantInit{}, http.StatusBadRequest, ErrIdentityEmpty
|
||||
}
|
||||
|
||||
roomName := livekit.RoomName(r.FormValue("room"))
|
||||
reconnectParam := r.FormValue("reconnect")
|
||||
autoSubParam := r.FormValue("auto_subscribe")
|
||||
|
||||
Reference in New Issue
Block a user