authenticate(); } catch (Exception $th) { if ($th instanceof \Tymon\JWTAuth\Exceptions\TokenInvalidException) { return response()->json(['message' => 'Token Invalid'], 401); } else if ($th instanceof \Tymon\JWTAuth\Exceptions\TokenExpiredException) { return response()->json(['message' => 'Token Expired'], 401); }else{ return response()->json(['message' => 'Authorization code not found'], 401); } } return $next($request); } }