18F/identity-idp

View on GitHub
app/views/two_factor_authentication/webauthn_verification/show.html.erb

Summary

Maintainability
Test Coverage
<% self.title = @presenter.webauthn_title %>

<%= render PageHeadingComponent.new.with_content(@presenter.header) %>

<p>
  <%= @presenter.webauthn_help %>
</p>

<%= simple_form_for(
      '',
      url: login_two_factor_webauthn_path,
      method: :patch,
      html: {
        class: 'margin-bottom-1',
        id: 'webauthn_form',
      },
    ) do |f| %>
  <%= hidden_field_tag :platform, @presenter.platform_authenticator? %>

  <%= render WebauthnVerifyButtonComponent.new(
        credentials: @presenter.credentials,
        user_challenge: user_session[:webauthn_challenge],
      ).with_content(@presenter.authenticate_button_text) %>

  <%= f.input(
        :remember_device,
        as: :boolean,
        label: t('forms.messages.remember_device'),
        wrapper_html: { class: 'margin-y-5' },
        input_html: {
          class: 'usa-checkbox__input--bordered',
          checked: @presenter.remember_device_box_checked?,
        },
      ) %>

  <%= render 'two_factor_authentication/troubleshooting_options', presenter: @presenter %>
<% end %>
<%= render 'shared/cancel', link: @presenter.cancel_link %>