Skip to content

Commit 607b7e7

Browse files
committed
fixes
1 parent 35f1d72 commit 607b7e7

File tree

3 files changed

+35
-4
lines changed

3 files changed

+35
-4
lines changed

app/src/main/kotlin/com/x8bit/bitwarden/MainViewModel.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ class MainViewModel @Inject constructor(
363363
}
364364

365365
createCredentialRequest != null -> {
366+
//TODO only force verification for passkeys??
366367
// Set the user's verification status when a new FIDO 2 request is received to force
367368
// explicit verification if the user's vault is unlocked when the request is
368369
// received.

app/src/main/kotlin/com/x8bit/bitwarden/data/credentials/processor/CredentialProviderProcessorImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ class CredentialProviderProcessorImpl(
242242
)
243243
.setDescription(
244244
context.getString(
245-
BitwardenString.your_passkey_will_be_saved_to_your_bitwarden_vault_for_x, // TODO text
245+
BitwardenString.your_password_will_be_saved_to_your_bitwarden_vault_for_x,
246246
accountName,
247247
),
248248
)

app/src/main/kotlin/com/x8bit/bitwarden/ui/vault/feature/itemlisting/VaultItemListingViewModel.kt

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -978,8 +978,15 @@ class VaultItemListingViewModel @Inject constructor(
978978
cipherId = action.id,
979979
cipherView = cipherView,
980980
)
981-
}
982-
?: run {
981+
} ?: createCredentialRequest
982+
.providerRequest
983+
.getCreatePasswordCredentialRequestOrNull()
984+
?.let {
985+
handleItemClickForCreatePasswordCredentialRequest(
986+
cipherId = action.id,
987+
cipherView = cipherView,
988+
)
989+
} ?: run {
983990
sendAction(
984991
VaultItemListingsAction.Internal.CredentialOperationFailureReceive(
985992
title = BitwardenString.an_error_has_occurred.asText(),
@@ -1126,6 +1133,29 @@ class VaultItemListingViewModel @Inject constructor(
11261133
}
11271134
}
11281135

1136+
private fun registerCredentialToCipher(
1137+
cipherView: CipherView,
1138+
providerRequest: ProviderCreateCredentialRequest,
1139+
) {
1140+
when (providerRequest.callingRequest) {
1141+
is CreatePublicKeyCredentialRequest -> registerFido2CredentialToCipher(
1142+
cipherView,
1143+
providerRequest,
1144+
)
1145+
1146+
is CreatePasswordRequest -> registerPasswordCredentialToCipher(
1147+
cipherView,
1148+
providerRequest,
1149+
)
1150+
1151+
else ->
1152+
showCredentialManagerErrorDialog(
1153+
BitwardenString.credential_operation_failed_because_the_request_is_invalid
1154+
.asText(),
1155+
)
1156+
}
1157+
}
1158+
11291159
private fun registerFido2CredentialToCipher(
11301160
cipherView: CipherView,
11311161
providerRequest: ProviderCreateCredentialRequest,
@@ -1979,7 +2009,7 @@ class VaultItemListingViewModel @Inject constructor(
19792009
state.createCredentialRequest
19802010
?.providerRequest
19812011
?.let { request ->
1982-
registerFido2CredentialToCipher(
2012+
registerCredentialToCipher(
19832013
cipherView = cipherView,
19842014
providerRequest = request,
19852015
)

0 commit comments

Comments
 (0)