Skip to content

Commit

Permalink
add back links on 2fa pages
Browse files Browse the repository at this point in the history
  • Loading branch information
kennyevil committed Oct 19, 2023
1 parent 1108600 commit ac3a0b7
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
<% title = "Enter the access code" %>
<% page_title(title, errors: @form.errors.any?) %>

<% if @form.user&.multiple_secondary_authentication_methods? %>
<% content_for(:after_header) do %>
<%= govukBackLink(text: "Back", href: new_secondary_authentication_method_path) %>
<% content_for :after_header do %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<% if @form.user&.multiple_secondary_authentication_methods? %>
<%= govuk_back_link(href: new_secondary_authentication_method_path) %>
<% else %>
<%= govuk_back_link(href: request.referer) %>
</div>
</div>
<% end %>
<% end %>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
<% title = "Enter a recovery code" %>
<% page_title(title, errors: @form.errors.any?) %>
<% content_for :after_header do %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<%= govuk_back_link(href: request.referer) %>
</div>
</div>
<% end %>

<% if @form.user&.multiple_secondary_authentication_methods? %>
<% content_for(:after_header) do %>
<%= govukBackLink(text: "Back", href: new_secondary_authentication_method_path) %>
<% content_for :after_header do %>
<% if @form.user&.multiple_secondary_authentication_methods? %>
<%= govuk_back_link( href: new_secondary_authentication_method_path) %>
<% else %>
<%= govuk_back_link(href: request.referer) %>
<% end %>
<% end %>

Expand Down
28 changes: 17 additions & 11 deletions cosmetics-web/app/views/secondary_authentication/sms/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@
<% page_title(title, errors: @form.errors.any?) %>

<% content_for(:after_header) do %>
<%=
if @form.user&.mobile_number_pending_verification? && !request.referer&.end_with?("two-factor/sms/setup")
if submit_domain?
button_to(registration_reset_account_security_path, method: :delete, class: "button-link govuk-back-link") { "Back" }
elsif support_domain?
button_to(reset_complete_registration_support_user_path(@form.user), method: :delete, class: "button-link govuk-back-link") { "Back" }
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<%=
if @form.user&.mobile_number_pending_verification? && !request.referer&.end_with?("two-factor/sms/setup")
if submit_domain?
button_to(registration_reset_account_security_path, method: :delete, class: "button-link govuk-back-link") { "Back" }
elsif support_domain?
button_to(reset_complete_registration_support_user_path(@form.user), method: :delete, class: "button-link govuk-back-link") { "Back" }
else
button_to(reset_complete_registration_user_path(@form.user), method: :delete, class: "button-link govuk-back-link") { "Back" }
end
elsif !@form.user&.mobile_number_pending_verification? && @form.user&.multiple_secondary_authentication_methods?
govuk_back_link(href: new_secondary_authentication_method_path)
else
button_to(reset_complete_registration_user_path(@form.user), method: :delete, class: "button-link govuk-back-link") { "Back" }
govuk_back_link(href: request.referer)
end
elsif !@form.user&.mobile_number_pending_verification? && @form.user&.multiple_secondary_authentication_methods?
govukBackLink(text: "Back", href: new_secondary_authentication_method_path)
end
%>
%>
</div>
</div>
<% end %>

<div class="govuk-grid-row">
Expand Down

0 comments on commit ac3a0b7

Please sign in to comment.