mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 15:15:34 +03:00
Persist device key past a logout (#1207)
This commit is contained in:
parent
d7e3b74c25
commit
6390fe1ab4
2 changed files with 3 additions and 6 deletions
|
@ -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? =
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue