Mas*_* DY 3 javascript nestjs nestjs-passport
当我向身份验证/登录发出 POST 请求时,出现此错误
[Nest] 8344 - 10/07/2020, 17:59:32 [ExceptionsHandler] Strategy#authenticate must be overridden by subclass +811577ms
Run Code Online (Sandbox Code Playgroud)
错误:Strategy#authenticate 必须由 LocalStrategy.Strategy.authenticate 的子类覆盖(/home/damy/Projects/snippets/Typescript/simple-crud-with-nest/node_modules/passport-strategy/lib/strategy.js:21: 9)尝试(/home/damy/Projects/snippets/Typescript/simple-crud-with-nest/node_modules/passport/lib/middleware/authenticate.js:366:16)进行身份验证(/home/damy/Projects/)片段/Typescript/simple-crud-with-nest/node_modules/passport/lib/middleware/authenticate.js:367:7)位于/home/damy/Projects/snippets/Typescript/simple-crud-with-nest/node_modules/ @nestjs/passport/dist/auth.guard.js:87:3 at new Promise () at /home/damy/Projects/snippets/Typescript/simple-crud-with-nest/node_modules/@nestjs/passport/dist/ auth.guard.js:79:83 在 MixinAuthGuard。(/home/damy/Projects/snippets/Typescript/simple-crud-with-nest/node_modules/@nestjs/passport/dist/auth.guard.js:48:36) 在 Generator.next () 在 /home/damy /Projects/snippets/Typescript/simple-crud-with-nest/node_modules/@nestjs/passport/dist/auth.guard.js:20:71 在新的 Promise ()
这是我的本地策略代码 nestjs本地策略代码
您需要安装并使用passport-local. passport是一个抽象实现,它Strategy是一个abstract类,这意味着它不能直接运行。如果您passport-local改为使用,则实现已经存在。
| 归档时间: |
|
| 查看次数: |
2089 次 |
| 最近记录: |