Fix issue with token generation via DateTimeImmutable instead of int (dependency with lcobucci/jwt ^5.0) - #1282
Fix issue with token generation via DateTimeImmutable instead of int (dependency with lcobucci/jwt ^5.0)#1282RuslanKononov wants to merge 2 commits into
Conversation
| 'iat' => $this->clock->now(), | ||
| 'nbf' => $this->clock->now(), |
There was a problem hiding this comment.
Shouldn't these 2 entries have the same instance? Or is it irrelevant?
There was a problem hiding this comment.
it's irrelevant (it was time() before) but you are right, it's more correct to make same nanoseconds time for "initialization" and "not before". maybe it help someone with unit testing
maxhelias
left a comment
There was a problem hiding this comment.
For me it's ok as the LcobucciJWSProvider class hasn't configured the clock injection either.
| private ?ClockInterface $clock; | ||
|
|
||
| public function __construct(?int $ttl) | ||
| public function __construct(?int $ttl, ?ClockInterface $clock = null) |
There was a problem hiding this comment.
For the record changing the public API in a patch is forbidden as per semver, as such this will land in a new minor version. For eventual future contributions, consider splitting in 2 PRs: one that fixes the bug at hand. (using the clock) and one that changes the public API (allowing to inject a clock)
…(dependency with lcobucci/jwt ^5.0)
It was problem with generation of token from DTO that implement UserInterface and it was fixed via this changes.