[Koha-bugs] [Bug 17006] REST API: add route to change patron's password

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Nov 8 23:01:45 CET 2016


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17006

--- Comment #24 from Josef Moravec <josef.moravec at gmail.com> ---
Created attachment 57360
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=57360&action=edit
[SIGNED-OFF] Bug 17006: (follow-up) Use Koha::Exceptions for change password
endpoint

Koha::Exceptions are a nice way to handle erros and they should be used much
more than they are now. This patch adds Koha::Exceptions into
Koha::Patron->change_password_to sub and catches the exceptions in the
controller.

1. Apply patch
2. Run t/db_dependent/api/v1/patrons.t
3. Send PATCH request to http://library/api/v1/patrons/YYY/password
   where YYY is existing borrowernumber (borrowers flag required)
4. Make sure that password was changed.
5. Try also too short password, and wrong current password and observe
   that errors are displayed appropriately.

curl -X PATCH http://library/api/v1/patrons/123/password \
         --data '{"current_password":"123", "new_password":"1234"}' \
         --cookie 'CGISESSID=055ca5a9a3ad3fb5052143bd015c1c10'

Signed-off-by: Josef Moravec <josef.moravec at gmail.com>

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list