diff --git a/src/Google/JWT.php b/src/Google/JWT.php index 80791b5..fa656c4 100644 --- a/src/Google/JWT.php +++ b/src/Google/JWT.php @@ -177,9 +177,8 @@ public function addGenericObject(GenericObject $object): static */ public function sign(): string { - $payload = array_merge($this->except('key')->toArray(), [ - 'iat' => time(), - ]); + $payload = $this->removeEmptyValues($this->except('key')->toArray()); + $payload['iat'] = time(); return Encoder::encode($payload, $this->key, 'RS256'); }