Bug 30199: Do not generate jwt if patron does not exist
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 18 Mar 2022 09:26:48 +0000 (10:26 +0100)
committerKyle Hall <kyle@bywatersolutions.com>
Fri, 25 Mar 2022 14:39:03 +0000 (10:39 -0400)
commite5aeb047a563b20769d49c2777d47039581ca7bd
tree9c8427a48e700cdebb19dc9487a6830aff748823
parentc89fc01dacbc3f145efe568291ba723c93f3e445
Bug 30199: Do not generate jwt if patron does not exist

This is a follow-up patch for bug 29543. If an invalid cardnumber has
been used we should not generate a token.

Test Plan:
1. Set SelfCheckoutByLogin to 'cardnumber'.
2. Go to http://localhost:8080/cgi-bin/koha/sco/sco-main.pl
3. Enter an invalid carnumber like 'thisisabadcardnumber'
4. See the appropriate message "Sorry The userid thisisabadcardnumber was not found in the database. Please try again."
5. Try again with a different cardnumber and notice the same exact error message including the 'thisisabadcardnumber' cardnumber.
6. Apply this patch
7. Restart all the things!
8. Repeat steps 2-4
9. Try again with a different cardnumber, you should now see the correct
   cardnumber!

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
opac/sco/sco-main.pl