This commit is contained in:
Christophe Maudoux 2021-01-19 22:45:05 +01:00
parent a8174d58a7
commit d6e351ab90

View File

@ -19,7 +19,7 @@ use Mouse;
use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_REDIRECT); use Lemonldap::NG::Portal::Main::Constants qw(PE_OK PE_REDIRECT);
our $VERSION = '2.0.9'; our $VERSION = '2.0.11';
# OpenID Connect standard claims # OpenID Connect standard claims
use constant PROFILE => [ use constant PROFILE => [
@ -643,10 +643,7 @@ sub decodeJSON {
my $json_hash; my $json_hash;
eval { $json_hash = from_json( $json, { allow_nonref => 1 } ); }; eval { $json_hash = from_json( $json, { allow_nonref => 1 } ); };
$json_hash->{error} = "parse_error" if ($@);
if ($@) {
$json_hash->{error} = "parse_error";
}
return $json_hash; return $json_hash;
} }
@ -1476,15 +1473,12 @@ sub _applyType {
sub _forceType { sub _forceType {
my ( $self, $val, $type ) = @_; my ( $self, $val, $type ) = @_;
if ( $type eq "bool" ) {
return ( $val ? JSON::true : JSON::false );
}
if ( $type eq "int" ) { # Boolean
return ( $val ? JSON::true : JSON::false ) if ( $type eq "bool" );
# Coax into int # Coax into int
return ( $val + 0 ); return ( $val + 0 ) if ( $type eq "int" );
}
# Coax into string # Coax into string
return ( $val . "" ); return ( $val . "" );