]> git.koha-community.org Git - koha.git/commit
Bug 36575: Return correct patron when there is a shared userid / cardnumber
authorNick Clemens <nick@bywatersolutions.com>
Thu, 11 Apr 2024 09:39:03 +0000 (09:39 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Thu, 6 Jun 2024 08:49:20 +0000 (10:49 +0200)
commit39aeec0438a5392659dfa1c6983324ddb509e9f7
tree48e1d30e96ca46e06b1713ebe5c9ef26286a1173
parentc97b32a60e10d520e09a7a792cc91bccbb46ce7f
Bug 36575: Return correct patron when there is a shared userid / cardnumber

This patch moves some patron fetching code in C4/Auth to use to patron returned from the validation
methods and only try to fetch the patron (to check if locked, update attempts, etc) if we didn't authenticate

To test:
1 - Set a user to have userid = BANANA password = Password1
2 - Set a user to have cardnumber = BANANA password = Password2
3 - Hit the patron authentication API:
    http://localhost:8080/api/v1/auth/password/validation
    with data:
    { "identifier": "BANANA", "password":"Password1" }
    and:
    { "identifier": "BANANA", "password":"Password2" }
4 - Note you receive the same response for both
5 - Apply patch, restart all
6 - Repeat the API and confirm you get the correct patron for the password submitted

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit ff4e0c4293486d2db31d2f48d9f6f31d6470965a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/Auth.pm
t/db_dependent/Auth.t
t/db_dependent/api/v1/password_validation.t