我正在尝试通过Express和Keycloak实现受保护的API。
我的代码如下:
app.use(`/${process.env.VERSION}`, keycloak.protect(), routes.SecuredRouter);
app.use( keycloak.middleware( { logout: '/logout' } ));
调用注销端点时,会出现以下错误:
TypeError: request.kauth.grant.unstore is not a function
at logout (D:\projects\csus-api\csus-api\node_modules\keycloak-connect\middleware\logout.js:26:27)
at Layer.handle [as handle_request] (D:\projects\csus-api\csus-api\node_modules\express\lib\router\layer.js:95:5)
at trim_prefix (D:\projects\csus-api\csus-api\node_modules\express\lib\router\index.js:317:13)
at D:\projects\csus-api\csus-api\node_modules\express\lib\router\index.js:284:7
at Function.process_params (D:\projects\csus-api\csus-api\node_modules\express\lib\router\index.js:335:12)
at next (D:\projects\csus-api\csus-api\node_modules\express\lib\router\index.js:275:10)
谢谢