From 52bc36fc79ac1772bf636d5fff6322d960ac352d Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Tue, 26 Jan 2021 11:00:56 +0000 Subject: [PATCH] Require registration for verification actions Fixes https://github.com/vector-im/element-web/issues/16277 --- src/verification.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/verification.js b/src/verification.js index 819370f239..74e3897d3a 100644 --- a/src/verification.js +++ b/src/verification.js @@ -74,6 +74,10 @@ function UntrustedDeviceDialog(props) { export async function verifyDevice(user, device) { const cli = MatrixClientPeg.get(); + if (cli.isGuest()) { + dis.dispatch({action: 'require_registration'}); + return; + } // if cross-signing is not explicitly disabled, check if it should be enabled first. if (cli.getCryptoTrustCrossSignedDevices()) { if (!await enable4SIfNeeded()) { @@ -113,6 +117,10 @@ export async function verifyDevice(user, device) { export async function legacyVerifyUser(user) { const cli = MatrixClientPeg.get(); + if (cli.isGuest()) { + dis.dispatch({action: 'require_registration'}); + return; + } // if cross-signing is not explicitly disabled, check if it should be enabled first. if (cli.getCryptoTrustCrossSignedDevices()) { if (!await enable4SIfNeeded()) { @@ -128,6 +136,11 @@ export async function legacyVerifyUser(user) { } export async function verifyUser(user) { + const cli = MatrixClientPeg.get(); + if (cli.isGuest()) { + dis.dispatch({action: 'require_registration'}); + return; + } if (!await enable4SIfNeeded()) { return; }