Skip to content

Commit

Permalink
AP-4427: Add alert and area-live=assertive for screen readers and ref…
Browse files Browse the repository at this point in the history
…ormat sign in page
  • Loading branch information
skdejong committed Oct 24, 2023
1 parent 44cfac7 commit 07adbc7
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/saml_idp_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class SamlIdpController < SamlIdp::IdpController
layout "application"

def create
if params[:email].present?
provider = idp_authenticate(params[:email], params[:password])
Expand Down
39 changes: 39 additions & 0 deletions app/views/saml_idp/idp/new.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<%= page_template page_title: "Sign in", back_link: :none do %>

<% if @saml_idp_fail_msg %>
<div class="govuk-error-summary" data-module="govuk-error-summary">
<div role="alert" aria-live="assertive">
<h2 class="govuk-error-summary__title">
There is a problem
</h2>
<div id="saml_idp_fail_msg" class="govuk-error-summary__body">
<ul class="govuk-list govuk-error-summary__list">
<li>
<a data-turbo="false" href="#email">
<%= @saml_idp_fail_msg %>
</a>
</li>
</ul>
</div>
</div>
</div>
<% end %>

<%= form_tag do %>
<%= hidden_field_tag("SAMLRequest", params[:SAMLRequest]) %>

<div class="govuk-form-group">
<%= label_tag :email, nil, class: "govuk-label" %>
<%= email_field_tag :email, params[:email], autocapitalize: "off", autocorrect: "off", spellcheck: "false", size: 30, autocomplete: "off", class: "govuk-input" %>
</div>

<div class="govuk-form-group">
<%= label_tag :password, nil, class: "govuk-label" %>
<%= password_field_tag :password, params[:password], autocapitalize: "off", autocorrect: "off", spellcheck: "false", size: 30, autocomplete: "off", class: "govuk-input" %>
</div>

<%= submit_tag "Sign in", class: "govuk-button" %>

<% end %>

<% end %>

0 comments on commit 07adbc7

Please sign in to comment.