-
Notifications
You must be signed in to change notification settings - Fork 832
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR adds the TOTP matching flow to the app (#4042)
- Loading branch information
1 parent
641a48f
commit e745017
Showing
14 changed files
with
451 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
app/src/main/java/com/x8bit/bitwarden/ui/vault/feature/addedit/util/TotpDataExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.x8bit.bitwarden.ui.vault.feature.addedit.util | ||
|
||
import com.x8bit.bitwarden.ui.vault.feature.addedit.VaultAddEditState | ||
import com.x8bit.bitwarden.ui.vault.model.TotpData | ||
|
||
/** | ||
* Returns pre-filled content that may be used for an "add" type | ||
* [VaultAddEditState.ViewState.Content] during a TOTP creation event. | ||
*/ | ||
fun TotpData.toDefaultAddTypeContent( | ||
isIndividualVaultDisabled: Boolean, | ||
): VaultAddEditState.ViewState.Content = VaultAddEditState.ViewState.Content( | ||
common = VaultAddEditState.ViewState.Content.Common( | ||
name = (this.issuer ?: this.accountName).orEmpty(), | ||
), | ||
isIndividualVaultDisabled = isIndividualVaultDisabled, | ||
type = VaultAddEditState.ViewState.Content.ItemType.Login(totp = this.uri), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.