diff --git a/src/backend/core/tests/rooms/test_api_rooms_retrieve.py b/src/backend/core/tests/rooms/test_api_rooms_retrieve.py index d27b13bf..e5c3fc46 100644 --- a/src/backend/core/tests/rooms/test_api_rooms_retrieve.py +++ b/src/backend/core/tests/rooms/test_api_rooms_retrieve.py @@ -12,7 +12,7 @@ import pytest from rest_framework.test import APIClient from ...factories import RoomFactory, UserFactory, UserResourceAccessFactory -from ...models import RoomAccessLevel, RoleChoices +from ...models import RoleChoices, RoomAccessLevel pytestmark = pytest.mark.django_db diff --git a/src/backend/core/utils.py b/src/backend/core/utils.py index 02d609c2..79a70ad3 100644 --- a/src/backend/core/utils.py +++ b/src/backend/core/utils.py @@ -129,7 +129,11 @@ def generate_token( .with_identity(identity) .with_name(display_name) .with_attributes( - {"color": color, "room_role": role } + { + "color": color, + "room_role": role, + "is_authenticated": "true" if user.is_authenticated else "false", + } ) ) diff --git a/src/frontend/src/features/rooms/utils/getParticipantIsAuthenticated.ts b/src/frontend/src/features/rooms/utils/getParticipantIsAuthenticated.ts new file mode 100644 index 00000000..9b55dcde --- /dev/null +++ b/src/frontend/src/features/rooms/utils/getParticipantIsAuthenticated.ts @@ -0,0 +1,8 @@ +import type { Participant } from 'livekit-client' + +export const getParticipantIsAuthenticated = ( + participant: Participant +): boolean => { + const isAuthenticated = participant.attributes?.is_authenticated + return isAuthenticated == 'true' +}