Support HS-preferred Secure Backup setup methods
This adds support for the `secure_backup_setup_methods` key, which allows HS admins to state that Element should simplify down to only one setup method, rather than offering both. Fixes https://github.com/vector-im/element-web/issues/15238
This commit is contained in:
parent
8ec7e7c714
commit
115c7ccd4e
3 changed files with 67 additions and 29 deletions
|
@ -38,3 +38,19 @@ export function isSecureBackupRequired(): boolean {
|
|||
const wellKnown = getE2EEWellKnown();
|
||||
return wellKnown && wellKnown["secure_backup_required"] === true;
|
||||
}
|
||||
|
||||
export function getSecureBackupSetupMethods(): string[] {
|
||||
const wellKnown = getE2EEWellKnown();
|
||||
if (
|
||||
!wellKnown ||
|
||||
!wellKnown["secure_backup_setup_methods"] ||
|
||||
!wellKnown["secure_backup_setup_methods"].length ||
|
||||
!(
|
||||
wellKnown["secure_backup_setup_methods"].includes("key") ||
|
||||
wellKnown["secure_backup_setup_methods"].includes("passphrase")
|
||||
)
|
||||
) {
|
||||
return ["key", "passphrase"];
|
||||
}
|
||||
return wellKnown["secure_backup_setup_methods"];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue