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)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 25 Mar 2022 00:22:10 +0000 (14:22 -1000)
commitd753755590b8950519944a3c5d52e150655d1cd1
tree51a290a410784e6b7ffcf8f3c9c1ca743d0c690e
parent29e1681ff1e5e3b6d820d277c5a475ecdf846d21
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>
opac/sco/sco-main.pl