Persist device key past a logout (#1207)

This commit is contained in:
David Perez 2024-04-02 09:36:32 -05:00 committed by Álison Fernandes
parent d7e3b74c25
commit 6390fe1ab4
2 changed files with 3 additions and 6 deletions

View file

@ -126,12 +126,14 @@ class AuthDiskSourceImpl(
storePrivateKey(userId = userId, privateKey = null)
storeOrganizationKeys(userId = userId, organizationKeys = null)
storeOrganizations(userId = userId, organizations = null)
storeDeviceKey(userId = userId, deviceKey = null)
storePendingAuthRequest(userId = userId, pendingAuthRequest = null)
storeUserBiometricUnlockKey(userId = userId, biometricsKey = null)
storeMasterPasswordHash(userId = userId, passwordHash = null)
storePolicies(userId = userId, policies = null)
storeAccountTokens(userId = userId, accountTokens = null)
// Do not remove the DeviceKey on logout, that is persisted indefinitely unless
// the server no longer trusts the device.
}
override fun getLastActiveTimeMillis(userId: String): Long? =

View file

@ -182,10 +182,6 @@ class AuthDiskSourceTest {
fun `clearData should clear all necessary data for the given user`() {
val userId = "userId"
authDiskSource.storeDeviceKey(
userId = userId,
deviceKey = "9876-5432-1234",
)
authDiskSource.storePendingAuthRequest(
userId = userId,
pendingAuthRequest = PendingAuthRequestJson(
@ -233,7 +229,6 @@ class AuthDiskSourceTest {
authDiskSource.clearData(userId = userId)
assertNull(authDiskSource.getDeviceKey(userId = userId))
assertNull(authDiskSource.getPendingAuthRequest(userId = userId))
assertNull(authDiskSource.getUserBiometricUnlockKey(userId = userId))
assertNull(authDiskSource.getLastActiveTimeMillis(userId = userId))