Do not allow joining a call without E2EE key

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2023-08-09 13:48:38 +02:00
parent c4e5e1afb1
commit 935d2188f0
3 changed files with 26 additions and 13 deletions

View File

@@ -40,6 +40,7 @@ import { MuteStates, useMuteStates } from "./MuteStates";
import { useMediaDevices, MediaDevices } from "../livekit/MediaDevicesContext";
import { useRoomSharedKey } from "../e2ee/sharedKeyManagement";
import { PASSWORD_STRING, useUrlParams } from "../UrlParams";
import { useEnableE2EE } from "../settings/useSetting";
declare global {
interface Window {
@@ -244,6 +245,7 @@ export function GroupCallView({
}
}, [groupCall, state, leave]);
const [e2eeEnabled] = useEnableE2EE();
const [e2eeSharedKey, setE2EESharedKey] = useRoomSharedKey(
groupCall.room.roomId
);
@@ -275,6 +277,18 @@ export function GroupCallView({
groupCall.enter();
}, [groupCall]);
if (!password && !e2eeSharedKey && e2eeEnabled) {
return (
<ErrorView
error={
new Error(
"No E2EE key provided: please make sure the URL you're using to join this call has been retrieved using the in-app button."
)
}
/>
);
}
const livekitServiceURL =
groupCall.livekitServiceURL ?? Config.get().livekit?.livekit_service_url;
if (!livekitServiceURL) {