Hide some warnings (#1487)

This commit is contained in:
Xavier Guimard 2018-08-15 22:47:23 +02:00
parent 9b39f2e44c
commit 52348ecbb0
2 changed files with 13 additions and 8 deletions

View File

@ -307,8 +307,11 @@ sub _displayRegister {
[] ];
}
my $_2fDevices = eval { from_json( $req->userData->{_2fDevices},
{ allow_nonref => 1 } ); };
my $_2fDevices =
$req->userData->{_2fDevices}
? eval { from_json( $req->userData->{_2fDevices},
{ allow_nonref => 1 } ); }
: undef;
unless ($_2fDevices) {
$self->logger->debug("No 2F Device found");

View File

@ -731,11 +731,13 @@ sub sendHtml {
$csp .= " $url";
}
my $url = $args{params}->{URL};
if ( defined $url ) {
$self->logger->debug("Required Params URL : $url");
if ( defined $url and $url =~ s#(https?://[^/]+).*#$1# ) {
if ( $url =~ s#(https?://[^/]+).*#$1# ) {
$self->logger->debug("Set CSP form-action with Params URL : $url");
$csp .= " $url";
}
}
$csp .= ';';
# Deny using portal in frame except if it is required