🐛 Bug fixes of Video/Audio Call
This commit is contained in:
@ -137,7 +137,12 @@ func exchangeCallToken(c *fiber.Ctx) error {
|
||||
return c.JSON(fiber.Map{
|
||||
"token": tk,
|
||||
"endpoint": viper.GetString("meeting.endpoint"),
|
||||
"full_url": fmt.Sprintf("%s?jwt=%s", viper.GetString("meeting.endpoint"), url.QueryEscape(tk)),
|
||||
"full_url": fmt.Sprintf(
|
||||
"%s/%s?jwt=%s",
|
||||
viper.GetString("meeting.endpoint"),
|
||||
call.ExternalID,
|
||||
url.QueryEscape(tk),
|
||||
),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ func NewServer() {
|
||||
channels.Get("/:channel/calls", listCall)
|
||||
channels.Get("/:channel/calls/ongoing", getOngoingCall)
|
||||
channels.Post("/:channel/calls", authMiddleware, startCall)
|
||||
channels.Delete("/:channel/calls", authMiddleware, endCall)
|
||||
channels.Delete("/:channel/calls/ongoing", authMiddleware, endCall)
|
||||
channels.Post("/:channel/calls/ongoing/token", authMiddleware, exchangeCallToken)
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,8 @@ func EndCall(call models.Call) (models.Call, error) {
|
||||
}
|
||||
|
||||
func EncodeCallToken(call models.Call, user models.Account) (string, error) {
|
||||
tk := jwt.NewWithClaims(jwt.SigningMethodHS512, jwt.MapClaims{
|
||||
// Jitsi requires HS256 as algorithm, so we cannot use HS512
|
||||
tk := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
|
||||
"context": jwt.MapClaims{
|
||||
"user": jwt.MapClaims{
|
||||
"avatar": user.Avatar,
|
||||
|
Reference in New Issue
Block a user