Do not allow joining a call without E2EE key
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user