Handle room configuration that's set in the grant itself (#3120)
* Handle room configuration that's set in the grant itself * ensure refresh token contains updates * deps * dep --------- Co-authored-by: Paul Wells <paulwe@gmail.com>
This commit is contained in:
@@ -278,13 +278,13 @@ func (r *RoomManager) CreateRoom(ctx context.Context, req *livekit.CreateRoomReq
|
||||
// StartSession starts WebRTC session when a new participant is connected, takes place on RTC node
|
||||
func (r *RoomManager) StartSession(
|
||||
ctx context.Context,
|
||||
createRoom *livekit.CreateRoomRequest,
|
||||
pi routing.ParticipantInit,
|
||||
requestSource routing.MessageSource,
|
||||
responseSink routing.MessageSink,
|
||||
) error {
|
||||
sessionStartTime := time.Now()
|
||||
|
||||
createRoom := pi.CreateRoom
|
||||
room, err := r.getOrCreateRoom(ctx, createRoom)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -990,7 +990,9 @@ func (r *RoomManager) refreshToken(participant types.LocalParticipant) error {
|
||||
SetValidFor(tokenDefaultTTL).
|
||||
SetMetadata(grants.Metadata).
|
||||
SetAttributes(grants.Attributes).
|
||||
AddGrant(grants.Video)
|
||||
SetVideoGrant(grants.Video).
|
||||
SetRoomConfig(grants.GetRoomConfiguration()).
|
||||
SetRoomPreset(grants.RoomPreset)
|
||||
jwt, err := token.ToJWT()
|
||||
if err == nil {
|
||||
err = participant.SendRefreshToken(jwt)
|
||||
|
||||
Reference in New Issue
Block a user