mirror of
https://github.com/bitwarden/android.git
synced 2025-03-15 18:58:59 +03:00
BIT-1451, BIT-1453: logout on failed attempts (#833)
This commit is contained in:
parent
b3fa33a02c
commit
a88f28e5bc
2 changed files with 7 additions and 10 deletions
|
@ -125,8 +125,7 @@ class VaultUnlockViewModel @Inject constructor(
|
|||
}
|
||||
|
||||
private fun handleBiometricsLockOut() {
|
||||
// TODO: Handle biometrics lockout (BIT-1451)
|
||||
sendEvent(VaultUnlockEvent.ShowToast("Lock out not yet implemented".asText()))
|
||||
authRepository.logout()
|
||||
}
|
||||
|
||||
private fun handleBiometricsUnlockClick() {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.x8bit.bitwarden.ui.auth.feature.vaultunlock
|
||||
|
||||
import androidx.lifecycle.SavedStateHandle
|
||||
import app.cash.turbine.test
|
||||
import com.x8bit.bitwarden.R
|
||||
import com.x8bit.bitwarden.data.auth.datasource.disk.model.EnvironmentUrlDataJson
|
||||
import com.x8bit.bitwarden.data.auth.repository.AuthRepository
|
||||
|
@ -529,15 +528,14 @@ class VaultUnlockViewModelTest : BaseViewModelTest() {
|
|||
}
|
||||
|
||||
@Test
|
||||
fun `on BiometricsLockOut should emit ShowToast`() = runTest {
|
||||
fun `on BiometricsLockOut should log the current user out`() = runTest {
|
||||
every { authRepository.logout() } just runs
|
||||
val viewModel = createViewModel()
|
||||
|
||||
viewModel.eventFlow.test {
|
||||
viewModel.trySendAction(VaultUnlockAction.BiometricsLockOut)
|
||||
assertEquals(
|
||||
VaultUnlockEvent.ShowToast("Lock out not yet implemented".asText()),
|
||||
awaitItem(),
|
||||
)
|
||||
viewModel.trySendAction(VaultUnlockAction.BiometricsLockOut)
|
||||
|
||||
verify(exactly = 1) {
|
||||
authRepository.logout()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue