Fixes issue with API errors when logged in with username instead of barcode.