tymondesigns / jwt-auth

🔐 JSON Web Token Authentication for Laravel & Lumen
https://jwt-auth.com
MIT License
11.32k stars 1.54k forks source link

Conflict timezone Laravel 5.1 with JWT and dependency Carbon #1030

Open uscamayta1986 opened 7 years ago

uscamayta1986 commented 7 years ago

I'm using jwt.auth 0.5.10 in Laravel 5.1 , when I change 'timezone' => 'America/Lima' in (app/config) of Laravel. And then I try to use invalidate() method of jwt eg:

In Laravel

public function userTokenInvalid(Request $request) {

$Token = JWTAuth::getToken();
JWTAuth::setToken($token)->invalidate();

}

The following error occurs:

ErrorException in Carbon.php line 946: DateTime::setTimezone(): Can only do this for zones with ID for now

Here the image of the error: https://goo.gl/photos/VR5JbwXpaJuiWLRk7

Note: With the timezone => 'UTC' that comes by default in laravel, no error occurs and everything works perfect.

Walk-Code commented 7 years ago

@uscamayta1986 Can you tell me your solution? Cheers

Walk-Code commented 7 years ago

Cheers, it worked.

jbroadice commented 7 years ago

Unfortunately I don't have a timezone declaration anywhere in Lumen.

It seems to be that this issue has emerged after running composer update. But this seems strange since all my dependencies' version definitions are explicit, except a loose 5.2.* for the Lumen framework.

Guess I will have to pull back the composer.lock and vendor folder manually from my working production environment until more info on a fix / cause is understood.

I also don't see any errors / exceptions being thrown when calling ::refresh(). The request simply hangs, then times out after a while with no response.

ramibadran commented 7 years ago

Guys

any fix here, i also face same problem

ans-4175 commented 6 years ago

@Walk-Code whats the solution?

iml885203 commented 5 years ago

update nesbot/carbon to ^1.39.

composer require nesbot/carbon:^1.39

it work for me.

stale[bot] commented 3 years ago

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.