From a6776541b99de712a53350f039e4c720ad1243df Mon Sep 17 00:00:00 2001 From: Chloe Zermatten Date: Tue, 8 Apr 2025 14:36:32 +0000 Subject: [PATCH] Bug 39494: Announce status messaging on login page So that screen readers announce errors, add a role attribute set to "alert" and a aria-live attribute set to "assertive". Since the page reloads on each login attempt, the page will effectively be loaded with both attributes set (if there is an error) and so screens readers should be able to detect and announce the message. Test plan: 1) On the Koha OPAC, navigate to Home > Log in to your account 2) Attempt to login, entering an incorrect password 3) Inspect the HTML, and notice that the relevant element now has a role attribute set to "alert" and an aria-live attribute set to "assertive". Repeat steps 2-3, but instead of an incorrect password error, trigger: A) a timeout error B) a different IP address error C) a too many login attempts error D) an authorisation error (where we are authenticating with a third party) E) a shibboleth authentication error F) a CAS login error G) an invalid username/password error for an anonymous patron H) an anonymous patron error I) a password expired error Signed-off-by: Brendan Gallagher --- .../bootstrap/en/modules/opac-auth.tt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt index 5414b9e6ef..0a76cbbe56 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt @@ -61,21 +61,21 @@ [% IF ( timed_out ) %]
-

Sorry, your session has timed out. Please log in again.

+

Sorry, your session has timed out. Please log in again.

[% END %] [% IF ( different_ip ) %]
-

You are logging from a different IP address. Please log in again.

+

You are logging from a different IP address. Please log in again.

[% END %] [% IF invalid_username_or_password || too_many_login_attempts %]
-

You entered an incorrect username or password. Please try again! But note that passwords are case sensitive[% IF Koha.Preference('FailedLoginAttempts') %]and that your account will be locked out after a fixed number of failed login attempts[% END %]. Please contact a library staff member if you continue to have problems.

-

There was an error authenticating to external identity provider

+

There was an error authenticating to external identity provider

[% auth_error | html %]

[% END %] @@ -94,7 +94,7 @@ [% IF ( invalidShibLogin ) %]
-

Sorry, your Shibboleth identity does not match a valid library identity.

+ [% UNLESS ( Koha.Preference('OPACShibOnly') ) %] [% IF ( casAuthentication ) %] [% IF ( invalidCasLogin ) %] @@ -142,7 +142,7 @@ [% IF ( invalidCasLogin ) %]
-

Sorry, the CAS login failed.

+
[% END %] @@ -202,18 +202,18 @@ [% IF !(invalid_username_or_password || too_many_login_attempts) and is_anonymous_patron %]
-

Error: You can't log in as the anonymous patron!

+

Error: You can't log in as the anonymous patron!

[% END %] [% IF !(invalid_username_or_password || too_many_login_attempts) and password_has_expired %] [% IF date_enrolled == password_expiration_date %]
-

Error: It's your first login! You need to reset your password.

+

Error: It's your first login! You need to reset your password.

[% ELSE %]
-

Error: Your password has expired!

+

Error: Your password has expired!

[% END %] [% IF Koha.Preference('EnableExpiredPasswordReset') %] -- 2.39.5