thephpleague / oauth2-server

A spec compliant, secure by default PHP OAuth 2.0 Server
https://oauth2.thephpleague.com
MIT License
6.49k stars 1.12k forks source link

AccessTokenTrait::__toString gives different result each call #1389

Open KngGroup opened 6 months ago

KngGroup commented 6 months ago

Due to new DateTimeImmutable() is used inside convertToJWT method, it gives different result each call. Is it possible to add $issuedAt property to make this method pure? Many thanks

Sephster commented 6 months ago

Thanks for pointing this out. I'd never really thought that the to string method might be called more than once but makes total sense.

I will get a fix out for this soon. Working on getting a release candidate out for v9 just now so will see if I can bundle it with that. Thank you