🐛 Fix identity provide to livekit
This commit is contained in:
		@@ -152,7 +152,6 @@ func EncodeCallToken(user models.Account, call models.Call) (string, error) {
 | 
				
			|||||||
		isAdmin = true
 | 
							isAdmin = true
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	identity := fmt.Sprintf("%d", user.ID)
 | 
					 | 
				
			||||||
	grant := &auth.VideoGrant{
 | 
						grant := &auth.VideoGrant{
 | 
				
			||||||
		Room:      call.ExternalID,
 | 
							Room:      call.ExternalID,
 | 
				
			||||||
		RoomJoin:  true,
 | 
							RoomJoin:  true,
 | 
				
			||||||
@@ -161,7 +160,7 @@ func EncodeCallToken(user models.Account, call models.Call) (string, error) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	duration := time.Second * time.Duration(viper.GetInt("calling.token_duration"))
 | 
						duration := time.Second * time.Duration(viper.GetInt("calling.token_duration"))
 | 
				
			||||||
	tk := auth.NewAccessToken(viper.GetString("calling.api_key"), viper.GetString("calling.api_secret"))
 | 
						tk := auth.NewAccessToken(viper.GetString("calling.api_key"), viper.GetString("calling.api_secret"))
 | 
				
			||||||
	tk.AddGrant(grant).SetIdentity(identity).SetValidFor(duration)
 | 
						tk.AddGrant(grant).SetIdentity(user.Name).SetValidFor(duration)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return tk.ToJWT()
 | 
						return tk.ToJWT()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user