soon530 / nestjs-study

來學一下nestjs吧!
0 stars 0 forks source link

Authentication jwt #38

Open soon530 opened 2 years ago

soon530 commented 2 years ago

https://ithelp.ithome.com.tw/articles/10279579

soon530 commented 2 years ago
% yarn add @nestjs/jwt
yarn add v1.22.19
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > swagger-ui-express@4.5.0" has unmet peer dependency "express@>=4.0.0".
warning " > ts-loader@9.4.1" has unmet peer dependency "webpack@^5.0.0".
[4/4] 🔨  Building fresh packages...
success Saved lockfile.
success Saved 14 new dependencies.
info Direct dependencies
└─ @nestjs/jwt@9.0.0
info All dependencies
├─ @nestjs/jwt@9.0.0
├─ @types/jsonwebtoken@8.5.8
├─ buffer-equal-constant-time@1.0.1
├─ ecdsa-sig-formatter@1.0.11
├─ jsonwebtoken@8.5.1
├─ jwa@1.4.1
├─ jws@3.2.2
├─ lodash.includes@4.3.0
├─ lodash.isboolean@3.0.3
├─ lodash.isinteger@4.0.4
├─ lodash.isnumber@3.0.3
├─ lodash.isplainobject@4.0.6
├─ lodash.isstring@4.0.1
└─ lodash.once@4.1.1
✨  Done in 8.18s.
soon530 commented 2 years ago
% yarn add passport-jwt
yarn add v1.22.19
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > swagger-ui-express@4.5.0" has unmet peer dependency "express@>=4.0.0".
warning " > ts-loader@9.4.1" has unmet peer dependency "webpack@^5.0.0".
[4/4] 🔨  Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ passport-jwt@4.0.0
info All dependencies
└─ passport-jwt@4.0.0
✨  Done in 3.49s.
soon530 commented 2 years ago

協助開發時,可以做型別檢查,所以-D到開發去

% yarn add -D @types/passport-jwt
yarn add v1.22.19
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > swagger-ui-express@4.5.0" has unmet peer dependency "express@>=4.0.0".
warning " > ts-loader@9.4.1" has unmet peer dependency "webpack@^5.0.0".
[4/4] 🔨  Building fresh packages...
success Saved lockfile.
success Saved 2 new dependencies.
info Direct dependencies
└─ @types/passport-jwt@3.0.7
info All dependencies
├─ @types/jsonwebtoken@8.5.9
└─ @types/passport-jwt@3.0.7
✨  Done in 4.82s.