refactor: key rotation (#2383)

This commit is contained in:
Mo
2023-08-04 09:25:28 -05:00
committed by GitHub
parent a7f266bb68
commit 494436bdb6
65 changed files with 1354 additions and 1232 deletions

View File

@@ -87,7 +87,7 @@ const EditVaultModal: FunctionComponent<Props> = ({ onCloseDialog, existingVault
const isChangingPasswordType = vault.keyPasswordType !== passwordType
const isChangingKeyStorageMode = vault.keyStorageMode !== keyStorageMode
const getPasswordTypeParams = (): ChangeVaultKeyOptionsDTO['newPasswordType'] => {
const getPasswordTypeParams = (): ChangeVaultKeyOptionsDTO['newPasswordOptions'] => {
if (!isChangingPasswordType) {
throw new Error('Password type is not changing')
}
@@ -108,9 +108,9 @@ const EditVaultModal: FunctionComponent<Props> = ({ onCloseDialog, existingVault
}
if (isChangingPasswordType || isChangingKeyStorageMode) {
await application.vaults.changeVaultOptions({
await application.vaults.changeVaultKeyOptions({
vault,
newPasswordType: isChangingPasswordType ? getPasswordTypeParams() : undefined,
newPasswordOptions: isChangingPasswordType ? getPasswordTypeParams() : undefined,
newStorageMode: isChangingKeyStorageMode ? keyStorageMode : undefined,
})
}