diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CDA.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CDA.pm index de634fff2..07f75795d 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CDA.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CDA.pm @@ -47,6 +47,10 @@ sub changeUrldc { $self->p->updateSession( $req, $cdaInfos, $cdaSession->id ); + # We are about to redirect the user to the CDA application, + # dismiss any previously stored redirections (#1650) + delete $req->{pdata}->{_url}; + $req->{urldc} .= ( $urldc =~ /\?/ ? '&' : '?' ) . $self->{conf}->{cookieName} . "cda=" diff --git a/lemonldap-ng-portal/t/66-CDA-already-auth.t b/lemonldap-ng-portal/t/66-CDA-already-auth.t index dab7d2a3e..2b605aa94 100644 --- a/lemonldap-ng-portal/t/66-CDA-already-auth.t +++ b/lemonldap-ng-portal/t/66-CDA-already-auth.t @@ -51,6 +51,12 @@ count(1); my ($query) = expectRedirection( $res, qr#^http://test.example.org/\?(lemonldapcda=.*)$# ); +# Bug #1650 made the portal store an _url in pdata at this step +my $cookies = getCookies($res); + +ok( !defined( $cookies->{lemonldappdata} ), " Make sure no pdata is returned" ); +count(1); + # Handler part use_ok('Lemonldap::NG::Handler::Server'); use_ok('Lemonldap::NG::Common::PSGI::Cli::Lib');