diff --git a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Lib/PSGI.pm b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Lib/PSGI.pm index f1a2299e9..cf1bb22c8 100644 --- a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Lib/PSGI.pm +++ b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Lib/PSGI.pm @@ -128,7 +128,7 @@ sub _authAndTrace { eval "require $type"; die $@ if ($@); my ( $res, $session ) = $type->run( $req, $self->{rule} ); - eval { $self->portal( $type->tsv->{portal}->() ) }; + eval { $self->portal( $type->tsv->{portal}->() ) } unless $self->portal; $self->logger->warn($@) if $@; $req->userData($session) if ($session); @@ -201,7 +201,7 @@ sub userId { my $userId = $req->userData->{ $Lemonldap::NG::Handler::Main::tsv->{whatToTrace} || '_whatToTrace' } - || $req->userData->{'_user'} # Fix 2377 + || $req->userData->{'_user'} # Fix 2377 || 'anonymous'; $self->logger->debug("Returned userId: $userId"); diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Issuer.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Issuer.pm index 5b9a1bf8c..01e50e994 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Issuer.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Issuer.pm @@ -100,7 +100,7 @@ sub _redirect { $self->logger->debug( 'Add ' . $self->ipath . ', ' . $self->ipath . 'Path in keepPdata' ); push @{ $req->pdata->{keepPdata} }, $self->ipath, $self->ipath . 'Path'; - $req->{urldc} = $self->conf->{portal} . '/' . $self->path; + $req->{urldc} = $self->p->buildUrl( $self->path ); $req->pdata->{_url} = encode_base64( $req->urldc, '' ); $req->pdata->{issuerTs} = time; } @@ -128,7 +128,7 @@ sub _redirect { $self->restoreRequest( $_[0], $ir ); $self->cleanPdata( $_[0] ); return $self->run( @_, @path ); - } + } : () ) ] diff --git a/lemonldap-ng-portal/t/37-Issuer-Timeout.t b/lemonldap-ng-portal/t/37-Issuer-Timeout.t index f412a47d1..8ac7e382e 100644 --- a/lemonldap-ng-portal/t/37-Issuer-Timeout.t +++ b/lemonldap-ng-portal/t/37-Issuer-Timeout.t @@ -115,12 +115,12 @@ ok( count(1); # We now should be logged in, but lost the original URL -expectRedirection( $res, "http://auth.op.com//oauth2" ); +expectRedirection( $res, "http://auth.op.com/oauth2" ); my $id = expectCookie($res); ok( $res = $op->_get( - '//oauth2', + '/oauth2', accept => 'text/html', cookie => "lemonldap=$id; lemonldappdata=$pdata", ), diff --git a/lemonldap-ng-portal/t/74-2F-Required-Issuer-Timeouts.t b/lemonldap-ng-portal/t/74-2F-Required-Issuer-Timeouts.t index 4c704d5af..0b6a7f9af 100644 --- a/lemonldap-ng-portal/t/74-2F-Required-Issuer-Timeouts.t +++ b/lemonldap-ng-portal/t/74-2F-Required-Issuer-Timeouts.t @@ -142,12 +142,12 @@ SKIP: { ); my $id = expectCookie($res); $pdata = expectCookie( $res, 'lemonldappdata' ); - expectRedirection( $res, qr'http://auth.example.com//cas' ); + expectRedirection( $res, qr'http://auth.example.com/cas' ); # Follow redirection to TOTP form ok( $res = $client->_get( - '//cas', + '/cas', cookie => "lemonldap=$id; lemonldappdata=$pdata", accept => 'text/html', ),