Fix warning message

This commit is contained in:
Christophe Maudoux 2019-05-01 13:09:26 +02:00
parent a06d91a16e
commit cb9add6eac

View File

@ -1168,17 +1168,17 @@ sub createJWT {
my $digest; my $digest;
if ( $alg eq "HS256" ) { if ( $alg eq "HS256" && $client_secret ) {
$digest = hmac_sha256_base64( $jwt_header . "." . $jwt_payload, $digest = hmac_sha256_base64( $jwt_header . "." . $jwt_payload,
$client_secret ); $client_secret );
} }
if ( $alg eq "HS384" ) { if ( $alg eq "HS384" && $client_secret ) {
$digest = hmac_sha384_base64( $jwt_header . "." . $jwt_payload, $digest = hmac_sha384_base64( $jwt_header . "." . $jwt_payload,
$client_secret ); $client_secret );
} }
if ( $alg eq "HS512" ) { if ( $alg eq "HS512" && $client_secret ) {
$digest = hmac_sha512_base64( $jwt_header . "." . $jwt_payload, $digest = hmac_sha512_base64( $jwt_header . "." . $jwt_payload,
$client_secret ); $client_secret );
} }