Open MohammadMehrabani opened 1 year ago
Tymon\JWTAuth\Exceptions\JWTException
should be handled or it will result in a server internal exception when token is invalid (not provided / blacklisted / out of refresh time / ...)
a example is:
public function refresh()
{
try {
return $this->respondWithToken(auth()->refresh());
} catch (\Tymon\JWTAuth\Exceptions\JWTException $exception) {
throw new AuthenticationException($exception->getMessage());
}
}
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. fixed #2209 | #2157 | #2205 | #2056 | #2116 with: $this->middleware('auth:api', ['except' => ['login', 'refresh']]);