首页 > 解决方案 > 我如何在 Strapi 中实现 2FA(使用 OTP)?

问题描述

是否可以在 Strapi 中实现 2FA?如果是,那么我想在我的 Strapi CMS 中实施 2FA 我该如何做任何人都可以帮助我。

我正在用很多时间来尝试。

但它没有部分工作。

对于前端覆盖,它可以工作,但后端它不起作用。

正是我想在https://github.com/strapi/strapi/blob/master/packages/strapi-admin/config/routes.json/auth/local中修改我们的管理路由。

我想handler: "Auth.callback"https://github.com/strapi/strapi/blob/master/packages/strapi-admin/controllers/Auth.js中为重新捕获验证添加一项额外检查

标签: javascriptnode.jsstrapi

解决方案


如果要在管理面板中添加此功能,则必须对其进行自定义。

为此,您必须使用自定义概念

https://strapi.io/documentation/3.0.0-beta.x/concepts/customization.html

Admin extension是您必须使用的部分。

https://github.com/strapi/strapi/tree/master/packages/strapi-admin/admin/src/containers/AuthPage

之后,我建议您添加一个新端点来发送验证您的代码。您将不得不检查路由和控制器文档。

这与这个问题非常相似:

在 ContentType 控制器中检查密码

这是一个可以帮助你的视频:

https://www.loom.com/share/990d3f842ded4a879b27c0e77c5ac340


推荐阅读