tymondesigns / jwt-auth

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

Laravel - Refresh token exception #2000

Open svkmedia opened 4 years ago

svkmedia commented 4 years ago

Subject of the issue

I have implemented JWT auth into laravel project. Everything works as expected. I just want to get rid of exception when token refresh fail. Every time it fails it throws error code 500 and put error into log:

[2020-06-23 11:00:40] local.ERROR: Token has expired {"exception":"[object] (Tymon\JWTAuth\Exceptions\TokenExpiredException(code: 0): Token has expired at /home/vagrant/code/Admin/vendor/tymon/jwt-auth/src/Claims/Expiration.php:31)

How can I get rid of this error? I'm tracking all errors and this is just anoying...

Your environment

Q A
Bug? no
New Feature? no
Framework Laravel
Framework version 6
Package version dev-develop
PHP version 7.3
rheedwahn commented 4 years ago

I think what you can do is to catch the exception in your handler.php and return whatever message you want from there

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.