[Bug 43310] New: Migrate members/two_factor_auth.tt to use api-client.js
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43310 Bug ID: 43310 Summary: Migrate members/two_factor_auth.tt to use api-client.js Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Authentication Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: martin.renvoize@openfifth.co.uk CC: dpavlin@rot13.org Depends on: 34451 Target Milestone: --- members/two_factor_auth.tt uses raw jQuery.ajax() for POST calls to /api/v1/auth/two-factor/registration and /api/v1/auth/two-factor/registration/verification. These need to be migrated to api-client.js for proper CSRF token handling (bug 34451). This is also needed for t/db_dependent/selenium/authentication_2fa.t to pass with CSRF protection enabled. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43310 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |34451 Depends on|34451 | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43310 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43310 --- Comment #1 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 203757 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203757&action=edit Bug 43310: Migrate members/two_factor_auth.tt to use api-client.js This patch replaces raw jQuery.ajax() POST calls for 2FA registration and verification with the api-client.js pattern. Uses APIClient.default.koha.post since these are specialized auth endpoints without a dedicated api-client module. Test plan: 1. Apply patch 2. Enable TwoFactorAuthentication system preference 3. Go to your patron account > Two-factor authentication 4. Click "Enable two-factor authentication" => SUCCESS: QR code and secret displayed 5. Enter the PIN code and verify => SUCCESS: 2FA enabled, page reloads 6. Test with wrong PIN => SUCCESS: "Invalid PIN code" error shown 7. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org