Revert "Prevent portal from crashing when keepPdata=1 (#1893)"
This reverts commit 2b4defb2a9
and
implements a fix "at the source" instead. Should fix #2099.
This commit is contained in:
parent
22c1f7270c
commit
47068c51b8
|
@ -356,11 +356,7 @@ sub reloadConf {
|
||||||
|
|
||||||
# Clean $req->pdata after authentication
|
# Clean $req->pdata after authentication
|
||||||
push @{ $self->endAuth }, sub {
|
push @{ $self->endAuth }, sub {
|
||||||
|
my $tmp = $_[0]->pdata->{keepPdata} //= [];
|
||||||
my $tmp =
|
|
||||||
( ref( $_[0]->pdata->{keepPdata} ) eq 'ARRAY' )
|
|
||||||
? $_[0]->pdata->{keepPdata}
|
|
||||||
: [];
|
|
||||||
foreach my $k ( keys %{ $_[0]->pdata } ) {
|
foreach my $k ( keys %{ $_[0]->pdata } ) {
|
||||||
unless ( grep { $_ eq $k } @$tmp ) {
|
unless ( grep { $_ eq $k } @$tmp ) {
|
||||||
$self->logger->debug("Removing $k from pdata");
|
$self->logger->debug("Removing $k from pdata");
|
||||||
|
|
|
@ -162,10 +162,7 @@ sub authLogout {
|
||||||
my ( $self, $req ) = @_;
|
my ( $self, $req ) = @_;
|
||||||
my $res = $self->_authentication->authLogout($req);
|
my $res = $self->_authentication->authLogout($req);
|
||||||
$self->logger->debug('Cleaning pdata');
|
$self->logger->debug('Cleaning pdata');
|
||||||
my $tmp =
|
my $tmp = $req->pdata->{keepPdata} //= [];
|
||||||
( ref( $req->pdata->{keepPdata} ) eq 'ARRAY' )
|
|
||||||
? $req->pdata->{keepPdata}
|
|
||||||
: [];
|
|
||||||
foreach my $k ( keys %{ $req->pdata } ) {
|
foreach my $k ( keys %{ $req->pdata } ) {
|
||||||
delete $req->pdata->{$k} unless ( grep { $_ eq $k } @$tmp );
|
delete $req->pdata->{$k} unless ( grep { $_ eq $k } @$tmp );
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,13 @@ sub handler {
|
||||||
$self->logger->error("Bad JSON content in cookie pdata");
|
$self->logger->error("Bad JSON content in cookie pdata");
|
||||||
$req->pdata( {} );
|
$req->pdata( {} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Avoid fatal errors when using old keepPdata format
|
||||||
|
if ( $req->pdata->{keepPdata}
|
||||||
|
and not( ref $req->pdata->{keepPdata} eq "ARRAY" ) )
|
||||||
|
{
|
||||||
|
$req->pdata->{keepPdata} = [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
my $res = $self->Lemonldap::NG::Common::PSGI::Router::handler($req);
|
my $res = $self->Lemonldap::NG::Common::PSGI::Router::handler($req);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user