tymondesigns / jwt-auth

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

Cannot refresh an expired token even if the token is within the allowed refresh time #2209

Open vitorbizarra opened 1 year ago

vitorbizarra commented 1 year ago

Subject of the issue

I can refresh a non-expired token normally, but when I try to refresh an expired token, I get a 401 response with the message "Unauthenticated", even if the token is within the allowed refresh time.

My JWT .env variables (I didn't put the JWT_SECRET in the printscreen but it's on the .env file): imagem_2023-02-02_111036743

I saw other people with similar issues in the issues area but i cannot find any answer. Anyone have an idea how to resolve it?

Your environment

Q A
Bug? yes
New Feature? no
Framework Laravel
Framework version 9.47.0
Package version dev-develop
PHP version 8.1.2

Steps to reproduce

Generate a token and wait till it expires. When expired, try to refresh token.

Expected behaviour

Return the new token

Actual behaviour

Return an 401 Unauthorized response with the message: "Unauthenticated".

imagem_2023-02-02_110859717

seankoole commented 1 year ago

@vitorbizarra did you found the solution to this ?

vitorbizarra commented 1 year ago

Hello, @seankoole! Unfortunately not yet. :/