如何防止用户 1 在 Nesjs 应用程序中使用护照访问用户 2 的信息?
我已经有两个策略:
使用电子邮件/密码验证用户的本地策略。受此策略保护的路由返回一个 jwt 令牌。
验证给定 jwt 令牌的 jwt 策略。
现在,我想限制对路由的访问,例如users/:id实际上具有相同加密userId的 jwt 令牌。
users/:id
怎么做 ?
authentication node.js passport.js nestjs nestjs-passport
authentication ×1
nestjs ×1
nestjs-passport ×1
node.js ×1
passport.js ×1