diff --git a/lib/ResponseHandler.php b/lib/ResponseHandler.php index 852b5f0..14c8a65 100644 --- a/lib/ResponseHandler.php +++ b/lib/ResponseHandler.php @@ -101,7 +101,7 @@ protected function makeJWS($payload, $exp_time, $iss, $aud, $jwk_pem): string { 'data' => $payload, // Authentication Data ]; - if(array_key_exists('fiscalNumber', $payload)) { // Subject - fiscalNumber, only if exists + if(is_array($payload) && array_key_exists('fiscalNumber', $payload)) { // Subject - fiscalNumber, only if exists $data['sub'] = $payload['fiscalNumber']; } @@ -119,4 +119,4 @@ protected function makeJWS($payload, $exp_time, $iss, $aud, $jwk_pem): string { return $token; } -} \ No newline at end of file +}