diff --git a/pkg/server/calls_api.go b/pkg/server/calls_api.go index e0747c0..190b41f 100644 --- a/pkg/server/calls_api.go +++ b/pkg/server/calls_api.go @@ -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), + ), }) } } diff --git a/pkg/server/startup.go b/pkg/server/startup.go index e736f47..bc3458c 100644 --- a/pkg/server/startup.go +++ b/pkg/server/startup.go @@ -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) } diff --git a/pkg/services/calls.go b/pkg/services/calls.go index 23712b9..6bad367 100644 --- a/pkg/services/calls.go +++ b/pkg/services/calls.go @@ -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, diff --git a/settings.toml b/settings.toml index 3f4f37c..0e5a940 100644 --- a/settings.toml +++ b/settings.toml @@ -4,7 +4,7 @@ maintainer = "SmartSheep Studio" frontend = "https://lian.solsynth.dev" bind = "0.0.0.0:8447" -domain = "feed.smartsheep.studio" +domain = "im.solsynth.dev" secret = "LtTjzAGFLshwXhN4ZD4nG5KlMv1MWcsvfv03TSZYnT1VhiAnLIZFTnHUwR0XhGgi" content = "uploads" @@ -20,7 +20,7 @@ endpoint = "https://id.solsynth.dev" grpc_endpoint = "id.solsynth.dev:7444" [meeting] -client_id = "solarmeet" +client_id = "solsynth-meeting" client_secret = "1234567890" endpoint = "https://meet.solsynth.dev"