diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/Choice.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/Choice.pm index b127ad4b4..57cec5ba8 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/Choice.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/Choice.pm @@ -177,6 +177,7 @@ sub _buildAuthLoop { $req->env->{'REQUEST_URI'} ) ) { $url .= $req->env->{'REQUEST_URI'}; + $req->{cspFormAction} .= " $url"; } else { $url .= '#'; diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm index b530cd06d..a67b57882 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm @@ -738,6 +738,11 @@ sub sendHtml { $csp .= " $url"; } } + if ( defined $req->{cspFormAction} ) { + $self->logger->debug( + "Set CSP form-action with request URL: " . $req->{cspFormAction} ); + $csp .= " " . $req->{cspFormAction}; + } $csp .= ';'; # Deny using portal in frame except if it is required