From 9f42167d158d207739b7ccfb8e319d1e2c767488 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 3 Jul 2025 09:23:54 -0400 Subject: [PATCH] Bug 40275: Implement find_by_identifier for check_cookie_auth --- C4/Auth.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 069edd42116..fe6e4c0f2e0 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -1942,7 +1942,7 @@ sub check_cookie_auth { } elsif ($userid) { $session->param( 'lasttime', time() ); - my $patron = Koha::Patrons->find( { userid => $userid } ); + my $patron = Koha::Patrons->find_by_identifier($userid); # If the user modify their own userid # Better than 500 but we could do better @@ -1952,8 +1952,6 @@ sub check_cookie_auth { return ( "expired", undef ); } - $patron = Koha::Patrons->find( { cardnumber => $userid } ) - unless $patron; return ( "password_expired", undef ) if $patron->password_expired; my $flags = defined($flagsrequired) ? haspermission( $userid, $flagsrequired ) : 1; if ($flags) { -- 2.39.5 (Apple Git-154)