From bf39bb26cf5e81456bd4bb6708635d754c40086b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20COLLIN?= Date: Sun, 31 Jan 2021 20:47:22 +0100 Subject: [PATCH] Update Decrypt.php If the payload is null, then JsonConverter::decode fail with an incorrect argument error (waiting for string, null sent). By forcing cast , it allow process to keep going. I hesitated to throw an exception in that case, but i thought that a token without payload is possible after all. --- Decrypt.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Decrypt.php b/Decrypt.php index 2873d81..95af0fa 100644 --- a/Decrypt.php +++ b/Decrypt.php @@ -110,7 +110,7 @@ public function run(): JWT $jwt = new JWT(); $jwt->header->replace($jwe->getSharedProtectedHeader()); - $jwt->claims->replace(JsonConverter::decode($jwe->getPayload())); + $jwt->claims->replace((array)JsonConverter::decode((string)$jwe->getPayload())); $claimChecker = new Checker\ClaimCheckerManager($this->claimCheckers); $claimChecker->check($jwt->claims->all());