[EC-981] OTP handling - Set to selected cipher#2404
Merged
fedemkr merged 8 commits intofeature/EC-979-iOS-third-party-2fafrom Mar 7, 2023
Merged
Conversation
…age for the cipher selection and refactored it so that we have more code reuse
…existing-cipher # Conflicts: # src/Core/Constants.cs
…ird-party-2fa/EC-981-add-to-existing-cipher
mpbw2
reviewed
Mar 7, 2023
| // TODO: There's currently an issue on iOS where the toolbar item is not getting updated | ||
| // as the others somehow. Removing this so at least we get the circle with ".." instead | ||
| // of a white circle | ||
| if (Device.RuntimePlatform != Device.iOS) |
Contributor
There was a problem hiding this comment.
Is it possible the change of Priority of the avatar from -1 to -2 broke the original colorization trick you did for iOS? (I don't see any hardcoded positions but I may be missing something)
Member
Author
There was a problem hiding this comment.
That's a great suggestion and I think I didn't try that but I've created another task to track this issue so that I make progress with the whole feature. On this PR I won't be fixing this given that's something minor and can be fixed later on.
mpbw2
approved these changes
Mar 7, 2023
5 tasks
fedemkr
added a commit
that referenced
this pull request
Mar 9, 2023
* [EC-980] Added iOS otpauth handler (#2370) * EC-980 added Bitwarden as otpauth scheme handler * EC-980 Fix format * [EC-981] OTP handling - Set to selected cipher (#2404) * EC-981 Started adding OTP to existing cipher. Reused AutofillCiphersPage for the cipher selection and refactored it so that we have more code reuse * EC-981 Fix navigation on otp handling * EC-981 Fix formatting * EC-981 Added otp cipher selection callout and add close toolbar item when needed * PM-1131 implemented cipher creation from otp handling flow with otp key filled (#2407) * PM-1133 Updated empty states for search and cipher selection on otp flow (#2408)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change
Objective
Add the possibility to choose a cipher to set the scanned OTP handled by the Bitwarden app.
Code changes
AutofillCiphersPage -> CipherSelectionPage
Given that selecting a cipher on
Autofilland selecting it onOTP handlingis pretty much the same, theAutofillCiphersPagewas taken and renamed toCipherSelectionPageto have a common UI to share between these flows. The context changes depending on theAppOptionspassed to the page creating the appropriateViewModelfor each flow.A diagram can illustrate this better:
classDiagram class CipherSelectionPageViewModel <<Abstract>> CipherSelectionPageViewModel CipherSelectionPageViewModel <|-- AutofillCiphersPageViewModel CipherSelectionPageViewModel <|-- OTPCipherSelectionPageViewModel CipherSelectionPage --> CipherSelectionPageViewModelOther changes
AppOptionsOtpDatato get the data from the otp uriAutofillandOTPviewmodels depending on theAppOptions. Also, added logic forClose. Something to highlight, is that theAccount Switchingtoolbar item was left with the default..icon on iOS because there is an issue and it's not being updated correctly (it just shows a white backgrounded circle). So, for now I've just left it with the default one which IMO is better than the white circle.CipherSelectionPageVIewModeland removed things that are now in the abstract class. Additionally, the select flow was changed to accept anIGroupingsPageListItemto be more generic and flexible.CipherSelectionPageVIewModelclass. The suggested ciphers to show on loading are the ones which include theIssuerof the OTP if exists or theAccountNameotherwise.Prepare(...)method to have less logic on the view.CipherOptionsCommandto use the new async way. Added logic to show all ciphers if there's no search term and it comes from the OTP flow. Also, on selection it goes to the edit page of the cipher when coming from the OTP flow.OTPDatastruct.Screenshots
Cipher Selection
Cipher Search
OTP set on Cipher edition
Before you submit
dotnet format --verify-no-changes) (required)