Self check: Patron login fails when username different than barcode

Bug #1457544 reported by Brent Mills
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Invalid
Undecided
Unassigned

Bug Description

Evergreen 2.7.5
OpenSRF 2.4

Patrons are able to login through a selfcheck station with no apparent issue when the barcode/username are equal. However, if a patron with barcode: 278000000000000 and username: bmills attempts to login with their barcode the selfcheck fails the login session. If the patron logs in with their username, the session succeeds and checkout can continue.

I'm not sure, but I think this could be due to the selfcheck treating both the barcode/username as a username during authentication. The selfcheck.js file seems to only count a login as a barcode if it passes a regex test. If no regex is set for barcodes, then it gets labeled a usrname:

-- excerpts from selfcheck.js --

if (barcode_or_usrname.match(this.patronBarcodeRegex)) {
console.log('barcode');
barcode = barcode_or_usrname;
} else {
console.log('usrname');
usrname = barcode_or_usrname;
}

When fetching the patron, it seems to look at:

SelfCheckManager.prototype.fetchPatron = function(barcode, usrname) {

var patron_id = fieldmapper.standardRequest(
['open-ils.actor', 'open-ils.actor.user.retrieve_id_by_barcode_or_username'],
{params : [this.authtoken, barcode, usrname]}

Not a big deal when they're the same. However, if everything is coming out as username when no regex is set, the lookup fails when they're different:

Example Log:

- osrf_http_translator: [ACT:23209:./osrf_http_translator.c:303:14321530792320990] [ip address] [] open-ils.actor open-ils.actor.user.retrieve_id_by_barcode_or_username "my_auth_token", null, "278000000000000"

- osrf_http_translator: [ACT:23209:./osrf_http_translator.c:303:14321530792320991] [ip address] [] open-ils.actor open-ils.actor.user.fleshed.retrieve.authoritative "my_auth_token", {"stacktrace":"/usr/local/share/perl/5.10.1/OpenILS/Application/Actor.pm:3317 /usr/local/share/perl/5.10.1/OpenSRF/Application.pm:594 /usr/share/perl5/Error.pm:416","ilsevent":"","pid":"23524","desc":"","textcode":"ACTOR_USR_NOT_FOUND","servertime":"Wed May 20 13:24:59 2015"}

Brent Mills (brent-5)
summary: - Self ficheck: Patron login fails when username different than barcode
+ Self check: Patron login fails when username different than barcode
Brent Mills (brent-5)
Changed in evergreen:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.