From 8d6615927ffb4f1c0df48585c04256fcb58c2693 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 Signed-off-by: Martin Renvoize --- .../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 dc820f017c6..06bc78aa0bf 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') %] Your account will be locked after a fixed number of failed login attempts. @@ -87,7 +87,7 @@ [% IF auth_error %]

-

There was an error authenticating to external identity provider

+

There was an error authenticating to external identity provider

[% auth_error | html %]

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

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

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

Sorry, the CAS login failed.

+
[% END %] @@ -204,18 +204,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.49.0