Page MenuHomePhabricator

Use role=alert for TOTP and recovery code error messages
Open, Needs TriagePublicBUG REPORT

Description

What is the problem?

On authenticating, the error messages for TOTP and recovery codes don't have role=alert. This is recommended to let screen readers know to notify the user.

We do use role=alert for errors authenticating with WebAuthn.

Steps to reproduce problem
  1. Setup TOTP for an user on https://en.wikipedia.beta.wmcloud.org
  2. Logout and login again
  3. After entering your username and password
  4. Click "Use authenticator app" (if you are not already there)
  5. Turn on screen reader
  6. Enter an invalid TOTP value

Expected behaviour: Screen reader reads the errors message.
Observed behaviour: Screen reader does not.

Environment

Platform: MacOS Sequoia Safari using VoiceOver. Debian 12 Firefox using Orca.
Wiki(s): https://en.wikipedia.beta.wmcloud.org OATHAuth – (c702fa8) 10:45, 7 October 2025. WebAuthn – (1957699) 20:10, 3 October 2025.

Event Timeline

Hey i am claiming this task hope my changes will be helpful !

Hi — Verified +2 is green. Could someone with Code-Review/Submit rights please give Code-Review +2 and submit this change?
Bug: T406603 Thanks!

There's no patch attached to this task so potential reviewers following this project will not see it. Double check your commit follows https://www.mediawiki.org/wiki/Gerrit/Commit_message_guidelines.

Hi — Verified +2 is green. Could someone with Code-Review/Submit rights please give Code-Review +2 and submit this change?

Also, just because CI gives a V+2, doesn't mean the patch is ready for merging.

@Reedy i know that thats why i ask for review to know my mistakes and all thanks for highlighting my mistakes I'll do the changes according to your comment !

Change #1195361 had a related patch set uploaded (by Adarsh2406; author: Adarsh2406):

[mediawiki/extensions/OATHAuth@master] Add role=alert to TOTP and recovery-code error messages

https://gerrit.wikimedia.org/r/1195361

Change #1195361 abandoned by Adarsh2406:

[mediawiki/extensions/OATHAuth@master] Add role=alert to TOTP and recovery-code error messages

https://gerrit.wikimedia.org/r/1195361

Change #1195361 restored by Adarsh2406:

[mediawiki/extensions/OATHAuth@master] Add role=alert to TOTP and recovery-code error messages

https://gerrit.wikimedia.org/r/1195361

Change #1195361 abandoned by Adarsh2406:

[mediawiki/extensions/OATHAuth@master] Add role=alert to TOTP and recovery-code error messages

https://gerrit.wikimedia.org/r/1195361

@Adarsh2406 your patch looks pretty good and it addressed a lot of the issues that @Reedy mentioned. I wonder if you would be interested in reopening your patch?