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));
    }
]));

`

Screenshot_1

Screenshot_2

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (8 by maintainers)

Commits related to this issue

Most upvoted comments

The problem is most likely that the old version of tuupola/http-factory you are installing.

- Locking tuupola/http-factory (1.0.1)

It had a broken provide clause in composer.json which now seems to uninstall psr/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