diff --git a/src/Embed.php b/src/Embed.php index 4beef6d..6c69a33 100644 --- a/src/Embed.php +++ b/src/Embed.php @@ -67,7 +67,11 @@ private function encode($resource, $params) { $jwt = new \Lcobucci\JWT\Builder(); $jwt->set('resource', $resource); - $jwt->set('params', $params); + if (empty($params)) { + $jwt->set('params', (object)[]); + } else { + $jwt->set('params', $params); + } $jwt->sign(new \Lcobucci\JWT\Signer\Hmac\Sha256(), $this->key); return $jwt->getToken();