Skip to content

LG-5700 Fix replicated content for the "Select your authentication method" page#6261

Merged
theabrad merged 12 commits intomainfrom
lg-5700-select-auth
May 4, 2022
Merged

LG-5700 Fix replicated content for the "Select your authentication method" page#6261
theabrad merged 12 commits intomainfrom
lg-5700-select-auth

Conversation

@theabrad
Copy link
Contributor

Why?: Reduce the confusion in MFA by having "text message" for the text message field and "phone call" for the Phone Call field

changelog: Improvements, Content, Separate phone and sms text labels

changelog: Improvements, Content, Seperate phone and sms text labels
@theabrad theabrad requested review from gsa-manish and stevegsa April 27, 2022 19:18
@theabrad theabrad marked this pull request as ready for review April 29, 2022 18:03

return []
else
[TwoFactorAuthentication::SmsSelectionPresenter.new]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this line is not covered by any tests, should we add some?

def options
webauthn_platform_option + webauthn_option + piv_cac_option + totp_option +
phone_options + backup_code_option
phone_options + sms_option + voice_option + backup_code_option
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is sms_option + voice_option ever redundant with phone_options?

theabrad added 4 commits May 2, 2022 17:09
Realized these methods were not needed as two_factor_options_presenter
is only called when adding mfa options
Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

def info
if configuration.present?
t(
'two_factor_authentication.login_options.sms_info_html',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was sorta confused why this string already existed. I see that it exists here, despite the fact that (a) it'd never be reached and (b) if it were reached, it would produce the wrong string, since we're not interpolating the %{phone} variable.

when 'sms'
t('two_factor_authentication.login_options.sms')
when 'voice'
t('two_factor_authentication.login_options.voice')

Should we remove those cases from the default class?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are the for the labels. This would be overwriting info on these lines. Probably worth a delete if they are being overwritten anyways.

when 'sms'
t('two_factor_authentication.login_options.sms_info_html')
when 'voice'
t('two_factor_authentication.login_options.voice_info_html')

'two_factor_authentication.login_options.sms_info_html',
phone: configuration.masked_phone,
)
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not necessary given how we're currently using these presenters only when a configuration is present, but if the parent class's info is meant to handle the absence of any configuration, we could defer to super in an else? I don't feel strongly.

Suggested change
end
else
super
end

(Same applies for the other presenter)

@theabrad theabrad merged commit 4d6a4f1 into main May 4, 2022
@theabrad theabrad deleted the lg-5700-select-auth branch May 4, 2022 19:23
peggles2 pushed a commit that referenced this pull request May 5, 2022
…thod" page (#6261)

Separate Voice and SMS option text

changelog: Improvements, Content, Separate phone and sms text labels

* add option to not show sms voice if phone option is available

* remove voice and sms options from options_presenter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants