]> git.koha-community.org Git - koha.git/commit
Bug 32739: Allow other patron identifier on pwd validation
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 17 Jul 2023 18:48:20 +0000 (15:48 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Tue, 8 Aug 2023 06:05:46 +0000 (20:05 -1000)
commit8619cd650bfdf3ace52b9ab203f450c587287dbe
tree597e25f6afc226789700ff60f2d3c731ddc09f0f
parent0cbf0ea51cc264e666d05c69f4524eac73cacaa4
Bug 32739: Allow other patron identifier on pwd validation

This patch takes a step forward on the password validation endpoint, by
adding  the `identifier` parameter and making it be allowed
to be the patron's `cardnumber` or the `userid`.

The current `userid` only validation option is kept as-is.

The implementation relies on `C4::Auth::checkpw` to query for the
patron.

To test:
1. Apply this patches
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/password_validation.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 69653a281dcbe2d0d610cbc2be6cc2718b52fca3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/REST/V1/Auth/Password.pm
api/v1/swagger/paths/auth.yaml
t/db_dependent/api/v1/password_validation.t