Add publish and subscribe permissions

This commit is contained in:
mplorentz
2026-03-03 09:45:42 -05:00
parent 1ef4705ac8
commit ff8709f581
+7 -3
View File
@@ -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()