CakeDC / cakephp-api

API Plugin for CakePHP
Other
61 stars 33 forks source link

JWT tokens not authorizing until a minute after refresh #75

Closed SplicePHP closed 3 years ago

SplicePHP commented 3 years ago

Hi, I don't know if anyone else is having this issue. After a response from the refresh token I get forbidden access until about a second after the token was refreshed. In CakeDC\Api\Service\Action\Auth\JwtTokenTrait around line 40 inside the generateTokenResponse method the line reads: $timestamp = new DateTimeImmutable(); setting it to: $timestamp = new DateTimeImmutable('-1 second'); fixes the issue.

skie commented 3 years ago

Have you checked that time on php server and database server is same?

skie commented 3 years ago

Closed as not reproduced.