From ff8709f5810c625c567bb425b783ae36db78661f Mon Sep 17 00:00:00 2001 From: mplorentz Date: Tue, 3 Mar 2026 09:45:42 -0500 Subject: [PATCH] Add publish and subscribe permissions --- zooid/livekit.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/zooid/livekit.go b/zooid/livekit.go index 2c5bd95..73edb10 100644 --- a/zooid/livekit.go +++ b/zooid/livekit.go @@ -24,11 +24,15 @@ type TokenEndpointResponse struct { } func generateLivekitToken(apiKey, apiSecret, room string, pubkey nostr.PubKey) string { - at := auth.NewAccessToken(apiKey, apiSecret) - at.SetVideoGrant(&auth.VideoGrant{ + grant := &auth.VideoGrant{ RoomJoin: true, Room: room, - }) + } + grant.SetCanPublish(true) + grant.SetCanSubscribe(true) + + at := auth.NewAccessToken(apiKey, apiSecret) + at.SetVideoGrant(grant) at.SetIdentity(pubkey.Hex()) jwt, _ := at.ToJWT()