Separate toasts for existing & new device verification
Separate device verification toasts into ones for devices that were there when the app loaded and a separate toast for each device that has appeared since. Reverts part of https://github.com/matrix-org/matrix-react-sdk/pull/4506 (clicking a device from your own UserInfo now triggers the legacy verification flow again). Fixes https://github.com/vector-im/riot-web/issues/13422 Fixes https://github.com/vector-im/riot-web/issues/13418
This commit is contained in:
parent
cf05beb4b8
commit
719faed2ff
10 changed files with 138 additions and 79 deletions
|
@ -23,7 +23,6 @@ import {RIGHT_PANEL_PHASES} from "./stores/RightPanelStorePhases";
|
|||
import {findDMForUser} from './createRoom';
|
||||
import {accessSecretStorage} from './CrossSigningManager';
|
||||
import SettingsStore from './settings/SettingsStore';
|
||||
import NewSessionReviewDialog from './components/views/dialogs/NewSessionReviewDialog';
|
||||
import {verificationMethods} from 'matrix-js-sdk/src/crypto';
|
||||
|
||||
async function enable4SIfNeeded() {
|
||||
|
@ -70,41 +69,34 @@ export async function verifyDevice(user, device) {
|
|||
}
|
||||
}
|
||||
|
||||
if (user.userId === cli.getUserId()) {
|
||||
Modal.createTrackedDialog('New Session Review', 'Starting dialog', NewSessionReviewDialog, {
|
||||
userId: user.userId,
|
||||
device,
|
||||
});
|
||||
} else {
|
||||
Modal.createTrackedDialog("Verification warning", "unverified session", UntrustedDeviceDialog, {
|
||||
user,
|
||||
device,
|
||||
onFinished: async (action) => {
|
||||
if (action === "sas") {
|
||||
const verificationRequestPromise = cli.legacyDeviceVerification(
|
||||
user.userId,
|
||||
device.deviceId,
|
||||
verificationMethods.SAS,
|
||||
);
|
||||
dis.dispatch({
|
||||
action: "set_right_panel_phase",
|
||||
phase: RIGHT_PANEL_PHASES.EncryptionPanel,
|
||||
refireParams: {member: user, verificationRequestPromise},
|
||||
});
|
||||
} else if (action === "legacy") {
|
||||
const ManualDeviceKeyVerificationDialog =
|
||||
sdk.getComponent("dialogs.ManualDeviceKeyVerificationDialog");
|
||||
Modal.createTrackedDialog("Legacy verify session", "legacy verify session",
|
||||
ManualDeviceKeyVerificationDialog,
|
||||
{
|
||||
userId: user.userId,
|
||||
device,
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
Modal.createTrackedDialog("Verification warning", "unverified session", UntrustedDeviceDialog, {
|
||||
user,
|
||||
device,
|
||||
onFinished: async (action) => {
|
||||
if (action === "sas") {
|
||||
const verificationRequestPromise = cli.legacyDeviceVerification(
|
||||
user.userId,
|
||||
device.deviceId,
|
||||
verificationMethods.SAS,
|
||||
);
|
||||
dis.dispatch({
|
||||
action: "set_right_panel_phase",
|
||||
phase: RIGHT_PANEL_PHASES.EncryptionPanel,
|
||||
refireParams: {member: user, verificationRequestPromise},
|
||||
});
|
||||
} else if (action === "legacy") {
|
||||
const ManualDeviceKeyVerificationDialog =
|
||||
sdk.getComponent("dialogs.ManualDeviceKeyVerificationDialog");
|
||||
Modal.createTrackedDialog("Legacy verify session", "legacy verify session",
|
||||
ManualDeviceKeyVerificationDialog,
|
||||
{
|
||||
userId: user.userId,
|
||||
device,
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function legacyVerifyUser(user) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue