Conversation
app/views/partials/multi_factor_authentication/_selected_mfa_options.html.erb
Outdated
Show resolved
Hide resolved
app/views/partials/multi_factor_authentication/_mfa_selection.html.erb
Outdated
Show resolved
Hide resolved
app/views/partials/multi_factor_authentication/_mfa_selection.html.erb
Outdated
Show resolved
Hide resolved
app/views/partials/multi_factor_authentication/_selected_mfa_options.html.erb
Outdated
Show resolved
Hide resolved
app/views/partials/multi_factor_authentication/_selected_mfa_options.html.erb
Outdated
Show resolved
Hide resolved
app/presenters/two_factor_authentication/selection_presenter.rb
Outdated
Show resolved
Hide resolved
app/presenters/two_factor_authentication/auth_app_selection_presenter.rb
Outdated
Show resolved
Hide resolved
app/views/partials/multi_factor_authentication/_mfa_selection.html.erb
Outdated
Show resolved
Hide resolved
aduth
left a comment
There was a problem hiding this comment.
Looking really good overall! Left a couple comments, but this is working well 👍
app/presenters/two_factor_authentication/selection_presenter.rb
Outdated
Show resolved
Hide resolved
app/views/partials/multi_factor_authentication/_selected_mfa_option.html.erb
Outdated
Show resolved
Hide resolved
app/presenters/two_factor_authentication/selection_presenter.rb
Outdated
Show resolved
Hide resolved
app/presenters/two_factor_authentication/backup_code_selection_presenter.rb
Outdated
Show resolved
Hide resolved
app/presenters/two_factor_authentication/selection_presenter.rb
Outdated
Show resolved
Hide resolved
app/presenters/two_factor_authentication/webauthn_platform_selection_presenter.rb
Outdated
Show resolved
Hide resolved
spec/presenters/two_factor_authentication/selection_presenter_spec.rb
Outdated
Show resolved
Hide resolved
spec/presenters/two_factor_authentication/selection_presenter_spec.rb
Outdated
Show resolved
Hide resolved
|
Before merging, can we also rebase or merge main, so we don't run any risk of issues with the branch being out-of-date? It looks like the merge base is pretty old (a5aa1bc). |
40b6944 to
dae132f
Compare
app/presenters/two_factor_authentication/webauthn_platform_selection_presenter.rb
Outdated
Show resolved
Hide resolved
e05e7f0 to
9cd8a69
Compare
aduth
left a comment
There was a problem hiding this comment.
Looks great! And thanks for the patience with all the reviews 😅
There was a problem hiding this comment.
Maybe for a follow-up, but it's rather unexpected to me that we need to be nil-tolerant on the users all of a sudden. It feels to me like maybe it's an issue with how we initialize the specs, but the setup presenters should ideally enforce that a user always exists.
There was a problem hiding this comment.
I'm troubleshooting an error that seemed to indicate GitLab wasn't happy about something to do with webauthn_configurations
https://gitlab.login.gov/lg/identity-idp/-/jobs/659011
--- Caused by: ---
# NoMethodError:
# undefined method `webauthn_configurations' for nil:NilClass
# ./app/presenters/two_factor_authentication/webauthn_platform_selection_presenter.rb:25:in `mfa_configuration_count'
I'll take a look from the spec angle and see if I can find the problem.
…t ability to select more than one MFA of the same type
da18522 to
7317bf6
Compare
Avoid having to deal with nil user
|
For posterity: @kevinsmaster5 and I paired on the last few commits, related to some build failures with We addressed this by:
Separately, we want to propose a refactor which would split up the presenter classes between set-up and sign-in, since:
|
| end | ||
|
|
||
| subject(:presenter) { described_class.new } | ||
| attr_reader :configuration, :user |
There was a problem hiding this comment.
I would not expect to see attr_reader in specs.
aduth
left a comment
There was a problem hiding this comment.
Couple minor notes on spec changes, but otherwise still LGTM 👍
| expect(presenter.disabled?).to eq(true) | ||
| end | ||
| end | ||
| end |
There was a problem hiding this comment.
I'd suggest adding test coverage for the new logic branch we added in 981b926
| end | |
| end | |
| context 'with configuration' do | |
| let(:single_configuration_only) { true } | |
| let(:mfa_configuration_count) { 1 } | |
| let(:configuration) { create(:phone_configuration, user: user) } | |
| before do | |
| allow(presenter).to receive(:configuration).and_return(configuration) | |
| end | |
| it { expect(presenter.disabled?).to eq(false) } | |
| end |
| context 'when a user has a phone configuration' do | ||
| let(:phone) { build(:phone_configuration, phone: '+1 888 867-5309') } | ||
|
|
||
| let(:user) {} |
There was a problem hiding this comment.
We could probably move this up to the top scope so that we only have to define it once (after line 3).
I'd also suggest making it create an actual value, since this is effectively setting user to nil, which we're not expecting to happen in any real-world usage.
let(:user) { build(:user) }Same note would apply to other changes where we define let(:user) {} this way.
🎫 Ticket
LG-9961
🛠 Summary of changes
Enables a user to select more than one of the same MFA type at account setup (except for Backup Codes and PIV). The confirmation view is removed and after the first option is set the user is redirected back to the secondary option view. When additional options are added they also return to the secondary option view until they click continue on to the account view.
Some style changes were added to give clearer feedback to the user about what options have been selected.
Figma
📜 Testing Plan
Steps to confirm the changes.
👀 Screenshots