mirror of
https://github.com/elyby/accounts.git
synced 2024-12-23 13:50:06 +05:30
Fix timestamp serialization format for JWT tokens
This commit is contained in:
parent
2442329895
commit
8a25ff9223
@ -62,7 +62,7 @@ class Component extends BaseComponent {
|
|||||||
*/
|
*/
|
||||||
public function create(array $payloads = [], array $headers = []): UnencryptedToken {
|
public function create(array $payloads = [], array $headers = []): UnencryptedToken {
|
||||||
$now = Carbon::now();
|
$now = Carbon::now();
|
||||||
$builder = (new Builder(new JoseEncoder(), ChainedFormatter::default()))->issuedAt($now->toDateTimeImmutable());
|
$builder = (new Builder(new JoseEncoder(), ChainedFormatter::withUnixTimestampDates()))->issuedAt($now->toDateTimeImmutable());
|
||||||
if (isset($payloads['sub'])) {
|
if (isset($payloads['sub'])) {
|
||||||
$builder = $builder->relatedTo($payloads['sub']);
|
$builder = $builder->relatedTo($payloads['sub']);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user