Hı, I trie slim 4 and tuupola/slim-jwt-auth. Everything is good but if token is wrong error function is not return json.I get the following error
Fatal error: Uncaught RuntimeException: No PSR-7 implementation available in
$app->add(new Tuupola\Middleware\JwtAuthentication([
"secret" => "supersecretkeyyoushouldnotcommittogithub",
"error" => function ($response, $arguments) {
$data["status"] = "error";
$data["message"] ='error';
return $response
->withHeader("Content-Type", "application/json")
->getBody()->write(json_encode($data, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
}
]));