Merge pull request #4407 from matrix-org/bwindels/checkifxsignisdisabledforlegacyverif
Fix: dont try to enable 4S if cross-signing is disabled
This commit is contained in:
commit
69e680da3c
1 changed files with 12 additions and 6 deletions
|
@ -61,15 +61,18 @@ function UntrustedDeviceDialog(props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function verifyDevice(user, device) {
|
export async function verifyDevice(user, device) {
|
||||||
|
const cli = MatrixClientPeg.get();
|
||||||
|
// if cross-signing is not explicitly disabled, check if it should be enabled first.
|
||||||
|
if (cli.getCryptoTrustCrossSignedDevices()) {
|
||||||
if (!await enable4SIfNeeded()) {
|
if (!await enable4SIfNeeded()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Modal.createTrackedDialog("Verification warning", "unverified session", UntrustedDeviceDialog, {
|
Modal.createTrackedDialog("Verification warning", "unverified session", UntrustedDeviceDialog, {
|
||||||
user,
|
user,
|
||||||
device,
|
device,
|
||||||
onFinished: async (action) => {
|
onFinished: async (action) => {
|
||||||
if (action === "sas") {
|
if (action === "sas") {
|
||||||
const cli = MatrixClientPeg.get();
|
|
||||||
const verificationRequestPromise = cli.legacyDeviceVerification(
|
const verificationRequestPromise = cli.legacyDeviceVerification(
|
||||||
user.userId,
|
user.userId,
|
||||||
device.deviceId,
|
device.deviceId,
|
||||||
|
@ -95,10 +98,13 @@ export async function verifyDevice(user, device) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function legacyVerifyUser(user) {
|
export async function legacyVerifyUser(user) {
|
||||||
|
const cli = MatrixClientPeg.get();
|
||||||
|
// if cross-signing is not explicitly disabled, check if it should be enabled first.
|
||||||
|
if (cli.getCryptoTrustCrossSignedDevices()) {
|
||||||
if (!await enable4SIfNeeded()) {
|
if (!await enable4SIfNeeded()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const cli = MatrixClientPeg.get();
|
}
|
||||||
const verificationRequestPromise = cli.requestVerification(user.userId);
|
const verificationRequestPromise = cli.requestVerification(user.userId);
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: "set_right_panel_phase",
|
action: "set_right_panel_phase",
|
||||||
|
|
Loading…
Reference in a new issue