我收到此错误, 当我在苗条项目中添加了身份验证中间件
奔跑的潘 src / middleware.php:54 PhanUndeclaredClassMethod从未声明的类\ Tuupola \ Middleware \ JwtAuthentication调用方法__construct
代码就像
$app->add(new \Tuupola\Middleware\JwtAuthentication([
"secure" => false,
"path" => "/api", /* or ["/api", "/admin"] */
"ignore" => ['/api/token'],
"attribute" => "decoded_token_data",
"secret" => $app->getContainer()->settings['jwt']['secret'],
"algorithm" => ["RS256"],
"error" => function ($response, $arguments) {
Logger::info('Invalid token', [
'status' => "error",
'message' => $arguments["message"]
]);
throw new \exceptions\InvalidTokenException();
}
]));
对此有什么解决办法吗?