♻️(backend) refactor LiveKit access token handling

Switched to using query parameters instead of GET requests, enabling the
inclusion of additional parameters when calling the create endpoint via POST.

Simplified the access token generation process by removing redundant calls to
`with_identity` and consolidating token generation steps. This streamlines the
method flow by preparing all necessary data before generating the access token.
This commit is contained in:
lebaudantoine
2024-08-07 16:25:54 +02:00
committed by aleb_the_flash
parent 37eea16a50
commit 28f43fb2c0
2 changed files with 13 additions and 11 deletions

View File

@@ -123,7 +123,7 @@ class RoomSerializer(serializers.ModelSerializer):
if role is not None or instance.is_public:
slug = f"{instance.id!s}".replace("-", "")
username = request.GET.get("username", None)
username = request.query_params.get("username", None)
output["livekit"] = {
"url": settings.LIVEKIT_CONFIGURATION["url"],