default timeout action should be LOGOUT when using TDE (#1216)

This commit is contained in:
David Perez
2024-04-03 11:56:33 -05:00
committed by Álison Fernandes
parent 37fb1fadb8
commit ab55b5e535
2 changed files with 196 additions and 145 deletions

View File

@@ -324,7 +324,21 @@ class SettingsRepositoryImpl(
// Set Vault Settings defaults
if (!isVaultTimeoutActionSet(userId = userId)) {
storeVaultTimeout(userId, VaultTimeout.FifteenMinutes)
storeVaultTimeoutAction(userId, VaultTimeoutAction.LOCK)
val hasTrustedDeviceEncryption = authDiskSource
.userState
?.activeAccount
?.profile
?.userDecryptionOptions
?.trustedDeviceUserDecryptionOptions != null
storeVaultTimeoutAction(
userId = userId,
vaultTimeoutAction = if (hasTrustedDeviceEncryption) {
// Always logout by default when using TDE
VaultTimeoutAction.LOGOUT
} else {
VaultTimeoutAction.LOCK
},
)
}
}