forked from coracle/zooid
Add publish and subscribe permissions
This commit is contained in:
+7
-3
@@ -24,11 +24,15 @@ type TokenEndpointResponse struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func generateLivekitToken(apiKey, apiSecret, room string, pubkey nostr.PubKey) string {
|
func generateLivekitToken(apiKey, apiSecret, room string, pubkey nostr.PubKey) string {
|
||||||
at := auth.NewAccessToken(apiKey, apiSecret)
|
grant := &auth.VideoGrant{
|
||||||
at.SetVideoGrant(&auth.VideoGrant{
|
|
||||||
RoomJoin: true,
|
RoomJoin: true,
|
||||||
Room: room,
|
Room: room,
|
||||||
})
|
}
|
||||||
|
grant.SetCanPublish(true)
|
||||||
|
grant.SetCanSubscribe(true)
|
||||||
|
|
||||||
|
at := auth.NewAccessToken(apiKey, apiSecret)
|
||||||
|
at.SetVideoGrant(grant)
|
||||||
at.SetIdentity(pubkey.Hex())
|
at.SetIdentity(pubkey.Hex())
|
||||||
|
|
||||||
jwt, _ := at.ToJWT()
|
jwt, _ := at.ToJWT()
|
||||||
|
|||||||
Reference in New Issue
Block a user