Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
Ajay Bura 2022-03-31 18:30:53 +05:30
parent ebec39bdd1
commit 289a386bf7
4 changed files with 23 additions and 6 deletions

View file

@ -7,15 +7,32 @@ import Text from '../../atoms/text/Text';
import Button from '../../atoms/button/Button';
import SettingTile from '../../molecules/setting-tile/SettingTile';
function setupCrossSigning() {
alert('setup');
const mx = initMatrix.matrixClient;
const crossSigning = mx.getStoredCrossSigningForUser(mx.getUserId());
if (!crossSigning) {
// TODO: bootstrap crossSigning.
}
// TODO: prompt user to backup to account data
}
function resetCrossSigning() {
alert('Reset');
// TODO: re-gen cross signing keys and update account data
}
function CrossSignin() {
return (
<SettingTile
title="Cross signing"
content={<Text variant="b3">Setup to verify and keep track of all your devices. Also required to enable secure encryption key backup.</Text>}
content={<Text variant="b3">Setup to verify and keep track of all your sessions. Also required to backup encrypted message.</Text>}
options={(
hasCrossSigningAccountData()
? <Button variant="danger">Reset</Button>
: <Button variant="primary">Setup</Button>
? <Button variant="danger" onClick={resetCrossSigning}>Reset</Button>
: <Button variant="primary" onClick={setupCrossSigning}>Setup</Button>
)}
/>
);

View file

@ -159,7 +159,7 @@ function DeviceManage() {
rounded
variant="caution"
iconSrc={InfoIC}
title="Setup cross signing in case you lose all your devices."
title="Setup cross signing in case you lose all your sessions."
/>
</div>
)}

View file

@ -48,7 +48,7 @@ function KeyBackup() {
title="Encrypted messages backup"
content={(
<>
<Text variant="b3">Online backup your encryption keys with your account data in case you lose access to your sessions. Your keys will be secured with a unique Security Key.</Text>
<Text variant="b3">Online backup your encrypted messages keys with your account data in case you lose access to your sessions. Your keys will be secured with a unique Security Key.</Text>
{!isCSEnabled && (
<InfoCard
style={{ marginTop: 'var(--sp-ultra-tight)' }}

View file

@ -176,7 +176,7 @@ function SecuritySection() {
</div>
<DeviceManage />
<div className="settings-security__card">
<MenuHeader>Encryption</MenuHeader>
<MenuHeader>Export/Import encryption keys</MenuHeader>
<SettingTile
title="Export E2E room keys"
content={(