Bug 34478: op-cud - Adjust C4::Auth code

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2023-09-21 10:23:41 +02:00
parent 348dbb1594
commit 77e3b58eee
Signed by: jonathan.druart
GPG key ID: A085E712BEF0E0F0

View file

@ -1328,7 +1328,14 @@ sub checkauth {
my $patron = $userid ? Koha::Patrons->find({ userid => $userid }) : undef;
$patron->update_lastseen('login') if $patron;
if ( defined $query->param('op') ) {
my $original_op_cud = $query->param('op-cud');
if ( $request_method eq 'GET' ) {
$query->param('op-cud', undef);
} elsif ( $request_method eq 'POST' ) {
$query->param('op', undef);
}
if ( defined $original_op_cud ) {
die "Cannot use GET for this request"
if $request_method ne 'POST';