]> 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)
committerTomas Cohen Arazi <tomascohen@theke.io>
Tue, 25 Jul 2023 19:25:37 +0000 (16:25 -0300)
commit69653a281dcbe2d0d610cbc2be6cc2718b52fca3
tree02f6c1cedbddd48df530cb4b65f9a6c541cf7197
parent419d1d4fe9e4dae2e98493b81a74b0193104acfd
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>
Koha/REST/V1/Auth/Password.pm
api/v1/swagger/paths/auth.yaml
t/db_dependent/api/v1/password_validation.t