https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43310

--- Comment #13 from Martin Renvoize (ashimema) 
<[email protected]> ---
QA follow-ups attached (2 patches). Summary of the review:
1. http-client.js rethrew failures with "throw Error(error)". As error is
already an Error, this turned the server message "Invalid pin" into "Error:
Invalid pin", so the check in two_factor_auth.tt never matched and a wrong PIN
produced an alert() instead of "Invalid PIN code". It now rethrows the original
error.
2. Dialog now builds its alert with textContent rather than formatting the
server message into HTML, and the verbs take an optional suppress_dialog
parameter so the 2FA page does not show both its own error and the generic
#messages warning.
3. two_factor_auth.tt: show err.message in alerts, drop the empty body and
unused argument, use .text() for API values.
4. HttpClient_spec.ts: new Cypress tests for the unprefixed error message and
for resolving null on 204.
Testing: HttpClient_spec.ts passes in KTD (3/3). I also ran the full flow in a
browser (enable, wrong PIN -> "Invalid PIN code" shown once with no alert,
correct PIN -> page reloads showing Enabled).
Not addressed here, to be handled on a follow-up bug: the verification endpoint
still uses in: formData in the swagger spec, which is why the page posts a
form-encoded body by hand; the 204 handling in http-client.js affects every
caller of the shared client; and there is no page-level Cypress spec for the
2FA flow.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to