egg-shell-decorators
egg-shell-decorators copied to clipboard
与egg-jwt结合使用时没发挥检查token作用
version
egg-shell-decorators: 1.0.7 egg-jwt: 3.1.6
复现
按照 egg-jwt 和 egg-shell-decorators 的配置过程,发现所有 controller 都不会检查 token。
问题所在:
// egg-shell-decorators/index.js
178: if (!ignoreJwt && !ignoreJwtAll && jwt && options.jwtValidation) {
179: await options.jwtValidation()(ctx, next);
180: }
发现这里的 options 还有个 jwtValidation,debug 过程中发现它一直是 undefined。 请问这里的 options.jwtValidation 还需要自己配吗?
看看中间件的配置