Jwt-auth: Keep getting "Token has expired" exception when generating token?

Created on 10 Mar 2018  路  4Comments  路  Source: tymondesigns/jwt-auth

It keeps throng a Tymon\JWTAuth\Exceptions\TokenExpiredException when calling $token = JWTAuth::attempt($req->only('email', 'password'));.

I'm not even sending a token, just trying to generate one.

Bug: yes
framework: laravel
version: 5.4.30
package version: 1.0.0-rc.2, 1.0.0-beta.3
php version: 7.1.3

Was working before but I updated to the latest rc version and then it just keeps giving me the error.

~
$token = JWTAuth::attempt($req->only('email', 'password'));
~

I tried down grading back but the error remained, no idea what's going on....

stale

Most helpful comment

I found out that it has something to do with the JWT_LEEWAY value.

~
'leeway' => env('JWT_LEEWAY', 0),
~

The default is 0, I had to set this to 1 second, bit strange...

All 4 comments

I found out that it has something to do with the JWT_LEEWAY value.

~
'leeway' => env('JWT_LEEWAY', 0),
~

The default is 0, I had to set this to 1 second, bit strange...

I noticed that this does not seem to have any effect on IssuedAt claim ... can anyone suggest why?

Hi, apologies for having multiple discussions, but the reason for this is outlined here
https://github.com/tymondesigns/jwt-auth/issues/1851#issuecomment-656230087

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

harveyslash picture harveyslash  路  3Comments

mihailo-misic picture mihailo-misic  路  3Comments

aofdev picture aofdev  路  3Comments

hfalucas picture hfalucas  路  3Comments

gamelife1314 picture gamelife1314  路  3Comments