Bug 37040: (RMaint follow-up) Restore passing CSRF error

This patch restores the plack.middleware.Koha.CSRF plack env setting to
allow passing to the errorDocument.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8cd6b43504)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Martin Renvoize 2024-06-11 11:30:22 +01:00 committed by Lucas Gass
parent e708597417
commit 647d5e9a9e
1 changed files with 1 additions and 0 deletions

View File

@ -82,6 +82,7 @@ sub call {
#NOTE: Other Middleware will take care of logging to correct place, as Koha::Logger doesn't know where to go here
warn $error;
$env->{'plack.middleware.Koha.CSRF'} = $error if !$env->{'plack.middleware.Koha.CSRF'};
my $res = Plack::Response->new( 403, [ 'Content-Type' => 'text/plain' ], ["Wrong CSRF token"] );
return $res->finalize;
}