BIT-1898: Two-factor auth should have access to device data if available (#1054)

This commit is contained in:
David Perez
2024-06-20 17:08:07 +01:00
committed by Álison Fernandes
parent f03d40d5d7
commit c0c88f5108
2 changed files with 25 additions and 0 deletions
@@ -1532,6 +1532,22 @@ class AuthRepositoryTest {
environmentUrlData = EnvironmentUrlDataJson.DEFAULT_US,
)
} returns SINGLE_USER_STATE_1
coEvery {
vaultRepository.unlockVault(
userId = SINGLE_USER_STATE_1.activeUserId,
email = SINGLE_USER_STATE_1.activeAccount.profile.email,
kdf = SINGLE_USER_STATE_1.activeAccount.profile.toSdkParams(),
privateKey = successResponse.privateKey,
initUserCryptoMethod = InitUserCryptoMethod.AuthRequest(
requestPrivateKey = DEVICE_REQUEST_PRIVATE_KEY,
method = AuthRequestMethod.MasterKey(
protectedMasterKey = DEVICE_ASYMMETRICAL_KEY,
authRequestKey = successResponse.key,
),
),
organizationKeys = null,
)
} returns VaultUnlockResult.Success
val finalResult = repository.login(
email = EMAIL,
password = null,