slim-jwt-auth: When I add jwt Middleware Its showing some error How to Solve this?
When I add jwt Middleware Its showing some error in every routes, but ignore routes are working fine @tuupola How to Solve this?
after update , my composer v2
`$app->add(new Tuupola\Middleware\JwtAuthentication([ “ignore”=>[“/auth/login”,“/auth/register”], “secret”=> “Token”, “error”=>function ($response,$arguments) { $data[“success”]= false; $data[“response”]=$arguments[“message”]; $data[“status_code”] = “401”;
return $response->withHeader("Content-type","application/json")
->getBody()->write(json_encode($data,JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
}
]));
`


About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (8 by maintainers)
Commits related to this issue
- Force atleast tuupola/http-factory:1.0.2 (fixes #193) — committed to tuupola/slim-jwt-auth by tuupola 4 years ago
The problem is most likely that the old version of
tuupola/http-factoryyou are installing.It had a broken
provideclause incomposer.jsonwhich now seems to uninstallpsr/http-factory. Should use atleast 1.0.2 or even better the latest which is 1.3.0.https://github.com/tuupola/http-factory/blob/master/CHANGELOG.md#101---2018-12-19