Skip to content

Commit

Permalink
Merge pull request #25 from Synchro/master
Browse files Browse the repository at this point in the history
Remove empty values before encoding
  • Loading branch information
chiiya authored Sep 6, 2024
2 parents 625833f + 0974146 commit 1c7bc8c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Google/JWT.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit 1c7bc8c

Please sign in to comment.