18F/identity-idp

View on GitHub
app/views/idv/otp_verification/show.html.erb

Summary

Maintainability
Test Coverage
<% content_for(:pre_flash_content) do %>
  <%= render StepIndicatorComponent.new(
        steps: step_indicator_steps,
        current_step: :verify_phone,
        locale_scope: 'idv',
        class: 'margin-x-neg-2 margin-top-neg-4 tablet:margin-x-neg-6 tablet:margin-top-neg-4',
      ) %>
<% end %>

<% self.title = t('titles.idv.enter_one_time_code') %>

<%= render PageHeadingComponent.new.with_content(t('two_factor_authentication.header_text')) %>

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

<%= simple_form_for('', method: :put) do |f| %>
  <%= render OneTimeCodeInputComponent.new(
        form: f,
        value: @code,
        numeric: false,
        autofocus: true,
        code_length: @otp_code_length,
        optional_prefix: '#',
        class: 'margin-bottom-5',
      ) %>
  <%= f.submit t('forms.buttons.submit.default'), class: 'margin-bottom-5' %>
<% end %>

<%= render ButtonComponent.new(
      url: idv_resend_otp_path,
      method: :post,
      outline: true,
      icon: :loop,
      class: 'margin-bottom-4',
    ).with_content(t('links.two_factor_authentication.send_another_code')) %>

<p>
  <%= t('instructions.mfa.wrong_number') %><br>
  <%= link_to(t('forms.two_factor.try_again'), idv_phone_path(step: 'phone_otp_verification')) %>
</p>

<%= render 'idv/doc_auth/cancel', step: 'phone_otp_verification' %>