my ($status, $cardnumber, $userid) = C4::Auth::checkpw( C4::Context->dbh, $username, $password );
if ( $status ) {
# Get the borrower
my $patron = Koha::Patrons->find( { cardnumber => $cardnumber } );
my $patron = Koha::Patrons->find( { userid => $userid } );
return { id => $patron->borrowernumber };
}
else {
my $plain_password = 'tomasito';
$builder->build({
source => 'Borrower',
value => {
cardnumber => undef,
});
my $borrower = $builder->build({
password => Koha::AuthUtils::hash_password( $plain_password )
-