You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This problem occurs when JWT_LEEWAY is set to 1 in the .env file.
Carbon\Carbon::rawAddUnit(): Argument #3 ($value) must be of type int|float, string given, called in C:\codes\hst\vendor\nesbot\carbon\src\Carbon\Traits\Units.php on line 356 {"exception":"[object] (TypeError(code: 0): Carbon\Carbon::rawAddUnit(): Argument #3 ($value) must be of type int|float, string given, called in C:\codes\hst\vendor\nesbot\carbon\src\Carbon\Traits\Units.php on line 356 at C:\codes\hst\vendor\nesbot\carbon\src\Carbon\Traits\Units.php:455)
[stacktrace]
#0 C:\codes\hst\vendor\nesbot\carbon\src\Carbon\Traits\Units.php(356): Carbon\Carbon::rawAddUnit(Object(Carbon\Carbon), 'second', '1') #1 C:\codes\hst\vendor\nesbot\carbon\src\Carbon\Traits\Date.php(2925): Carbon\Carbon->addUnit('second', '1', NULL) #2 C:\codes\hst\vendor\nesbot\carbon\src\Carbon\Traits\Date.php(2616): Carbon\Carbon->callModifierMethod('second', Array) #3 C:\codes\hst\vendor\tymon\jwt-auth\src\Support\Utils.php(51): Carbon\Carbon->__call('addSeconds', Array) #4 C:\codes\hst\vendor\tymon\jwt-auth\src\Claims\DatetimeTrait.php(80): Tymon\JWTAuth\Support\Utils::isPast(Object(Carbon\Carbon), '1') #5 C:\codes\hst\vendor\tymon\jwt-auth\src\Claims\Expiration.php(30): Tymon\JWTAuth\Claims\Expiration->isPast(1717051371) #6 [internal function]: Tymon\JWTAuth\Claims\Expiration->validatePayload()
The text was updated successfully, but these errors were encountered:
I solved it (and other similar issues) by adding the int cast (int) to every "time-based" config that may come from the .env file. For example: 'ttl' => (int) env('JWT_TTL', 60) 'refresh_ttl' => (int) env('JWT_REFRESH_TTL', 20160)
I solved it (and other similar issues) by adding the int cast (int) to every "time-based" config that may come from the .env file. For example: 'ttl' => (int) env('JWT_TTL', 60)'refresh_ttl' => (int) env('JWT_REFRESH_TTL', 20160)
Thank my issue solved as well by using (int) in jwt.php
in laravel 11.x
This problem occurs when JWT_LEEWAY is set to 1 in the .env file.
Carbon\Carbon::rawAddUnit(): Argument #3 ($value) must be of type int|float, string given, called in C:\codes\hst\vendor\nesbot\carbon\src\Carbon\Traits\Units.php on line 356 {"exception":"[object] (TypeError(code: 0): Carbon\Carbon::rawAddUnit(): Argument #3 ($value) must be of type int|float, string given, called in C:\codes\hst\vendor\nesbot\carbon\src\Carbon\Traits\Units.php on line 356 at C:\codes\hst\vendor\nesbot\carbon\src\Carbon\Traits\Units.php:455)
[stacktrace]
#0 C:\codes\hst\vendor\nesbot\carbon\src\Carbon\Traits\Units.php(356): Carbon\Carbon::rawAddUnit(Object(Carbon\Carbon), 'second', '1')
#1 C:\codes\hst\vendor\nesbot\carbon\src\Carbon\Traits\Date.php(2925): Carbon\Carbon->addUnit('second', '1', NULL)
#2 C:\codes\hst\vendor\nesbot\carbon\src\Carbon\Traits\Date.php(2616): Carbon\Carbon->callModifierMethod('second', Array)
#3 C:\codes\hst\vendor\tymon\jwt-auth\src\Support\Utils.php(51): Carbon\Carbon->__call('addSeconds', Array)
#4 C:\codes\hst\vendor\tymon\jwt-auth\src\Claims\DatetimeTrait.php(80): Tymon\JWTAuth\Support\Utils::isPast(Object(Carbon\Carbon), '1')
#5 C:\codes\hst\vendor\tymon\jwt-auth\src\Claims\Expiration.php(30): Tymon\JWTAuth\Claims\Expiration->isPast(1717051371)
#6 [internal function]: Tymon\JWTAuth\Claims\Expiration->validatePayload()
The text was updated successfully, but these errors were encountered: