]> 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)
committerPedro Amorim <pedro.amorim@ptfs-europe.com>
Mon, 28 Aug 2023 10:07:15 +0000 (10:07 +0000)
commit803f4351960409a25ca98e3fcc79bbfb66033944
tree612376f5b84e8568e9c7521598883da71334df6f
parentb7cc42789d73855287abea2dfbdd93c4b2e8eb65
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>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Koha/REST/V1/Auth/Password.pm
api/v1/swagger/paths/auth.yaml
t/db_dependent/api/v1/password_validation.t