diff --git a/app/presenters/two_factor_login_options_presenter.rb b/app/presenters/two_factor_login_options_presenter.rb index 355e06fc5ad..c9ddcdd710e 100644 --- a/app/presenters/two_factor_login_options_presenter.rb +++ b/app/presenters/two_factor_login_options_presenter.rb @@ -43,6 +43,7 @@ def restricted_options_warning_text end def options + return @options if defined?(@options) mfa = MfaContext.new(user) if @piv_cac_required @@ -63,7 +64,9 @@ def options # webauthn keys and phones. However, we only want to show one of each option # during login, except for phones, where we want to allow the user to choose # which MFA-enabled phone they want to use. - configurations.group_by(&:class).flat_map { |klass, set| klass.selection_presenters(set) } + @options = configurations.group_by(&:class).flat_map do |klass, set| + klass.selection_presenters(set) + end end def account_reset_or_cancel_link