egg-shell-decorators icon indicating copy to clipboard operation
egg-shell-decorators copied to clipboard

与egg-jwt结合使用时没发挥检查token作用

Open Dobility opened this issue 5 years ago • 1 comments

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 还需要自己配吗?

Dobility avatar Oct 16 '19 15:10 Dobility

看看中间件的配置

A-birdFlyHigner avatar Feb 20 '20 11:02 A-birdFlyHigner