diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm index 73a03a88f..8803764e5 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Display.pm @@ -76,6 +76,7 @@ sub display { MSG => $req->info, HIDDEN_INPUTS => $self->buildHiddenForm($req), ACTIVE_TIMER => $req->data->{activeTimer}, + FORM_ACTION => $req->data->{confirmFormAction} || "#", FORM_METHOD => $self->conf->{confirmFormMethod}, CHOICE_PARAM => $self->conf->{authChoiceParam}, CHOICE_VALUE => $req->data->{_authChoice}, 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 34db8c70a..7885538c0 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Issuer.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Issuer.pm @@ -12,6 +12,7 @@ use Mouse; use MIME::Base64; use IO::String; use URI::Escape; +use URI; use Lemonldap::NG::Common::FormEncode; use Lemonldap::NG::Portal::Main::Constants qw( PE_OK @@ -137,6 +138,10 @@ sub _forAuthUser { $self->restoreRequest( $req, $r ); @path = @{ $req->pdata->{ $self->ipath . 'Path' } } if ( $req->pdata->{ $self->ipath . 'Path' } ); + + # In case a confirm form is shown, we need it to POST on the + # current Path + $req->data->{confirmFormAction} = URI->new($req->uri)->path; } # Clean pdata: keepPdata has been set, so pdata must be cleaned here diff --git a/lemonldap-ng-portal/site/templates/bootstrap/confirm.tpl b/lemonldap-ng-portal/site/templates/bootstrap/confirm.tpl index f35a4d5d5..65d880797 100644 --- a/lemonldap-ng-portal/site/templates/bootstrap/confirm.tpl +++ b/lemonldap-ng-portal/site/templates/bootstrap/confirm.tpl @@ -2,7 +2,7 @@