Sha256: ec8336264970dae8ceeda2fa461ff37bc629d6d058760aca934d1dfaef5c12cb

Contents?: true

Size: 1.48 KB

Versions: 103

Compression:

Stored size: 1.48 KB

Contents

<%= render 'account/shared/box', divider: @backup_codes do |p| %>
  <% p.content_for :title, t("users.edit.two_factor.header") %>
  <% p.content_for :description, t("users.edit.two_factor.description_#{@user.otp_required_for_login? ? 'enabled' : 'disabled'}") %>
  <% p.content_for :body do %>
    <% if current_user.otp_required_for_login? %>
      <% if @backup_codes %>

        <%= render 'account/shared/alert' do %>
          <%= t('users.edit.two_factor.warning').html_safe %>
        <% end %>

        <p><%= t('users.edit.two_factor.instructions').html_safe %></p>

        <center class="py-4">
          <%= current_user.otp_qr_code.as_svg(
            offset: 0,
            color: '000',
            shape_rendering: 'crispEdges',
            module_size: 4,
            standalone: true
          ).html_safe %>
        </center>

        <p><%= t('users.edit.two_factor.recovery_codes').html_safe %></p>

        <center>
          <% @backup_codes.each do |code| %>
            <p><code><%= code %></code></p>
          <% end %>
        </center>

      <% end %>
    <% end %>
  <% end %>
  <% p.content_for :actions do %>
    <% if current_user.otp_required_for_login? %>
      <%= link_to t('users.edit.two_factor.buttons.disable'), account_two_factor_path, method: :delete, remote: true, class: "button" %>
    <% else %>
      <%= link_to t('users.edit.two_factor.buttons.enable'), account_two_factor_path, method: :post, remote: true, class: "button" %>
    <% end %>
  <% end %>
<% end %>

Version data entries

103 entries across 103 versions & 1 rubygems

Version Path
bullet_train-1.2.10 app/views/devise/registrations/_two_factor.html.erb
bullet_train-1.2.9 app/views/devise/registrations/_two_factor.html.erb
bullet_train-1.2.8 app/views/devise/registrations/_two_factor.html.erb
bullet_train-1.2.7 app/views/devise/registrations/_two_factor.html.erb
bullet_train-1.2.6 app/views/devise/registrations/_two_factor.html.erb
bullet_train-1.2.5 app/views/devise/registrations/_two_factor.html.erb
bullet_train-1.2.4 app/views/devise/registrations/_two_factor.html.erb
bullet_train-1.2.3 app/views/devise/registrations/_two_factor.html.erb
bullet_train-1.2.2 app/views/devise/registrations/_two_factor.html.erb
bullet_train-1.2.1 app/views/devise/registrations/_two_factor.html.erb
bullet_train-1.2.0 app/views/devise/registrations/_two_factor.html.erb
bullet_train-1.1.10 app/views/devise/registrations/_two_factor.html.erb
bullet_train-1.1.9 app/views/devise/registrations/_two_factor.html.erb
bullet_train-1.1.7 app/views/devise/registrations/_two_factor.html.erb
bullet_train-1.1.6 app/views/devise/registrations/_two_factor.html.erb
bullet_train-1.1.5 app/views/devise/registrations/_two_factor.html.erb
bullet_train-1.1.4 app/views/devise/registrations/_two_factor.html.erb
bullet_train-1.1.3 app/views/devise/registrations/_two_factor.html.erb
bullet_train-1.1.2 app/views/devise/registrations/_two_factor.html.erb
bullet_train-1.1.1 app/views/devise/registrations/_two_factor.html.erb