javascript - 我如何在 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中为重新捕获验证添加一项额外检查
解决方案
如果要在管理面板中添加此功能,则必须对其进行自定义。
为此,您必须使用自定义概念
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
之后,我建议您添加一个新端点来发送验证您的代码。您将不得不检查路由和控制器文档。
这与这个问题非常相似:
这是一个可以帮助你的视频:
推荐阅读
- python - 如何在没有链接的情况下访问网站的所有子目录?
- sql-server - SQL Server DELETE 查询性能
- javascript - 如何将var保存到本地计算机?
- charts - 使用 require.js 加载 chartjs 插件时出现问题
- c# - 如何找到Windows服务的可执行路径
- ionic-framework - 如何在角度变量上添加样式
- powershell - 如何防止 PowerShell 中的变量注入?
- html - 导航栏没有响应
- python - 线性同余生成器 - 如何选择种子和统计检验
- elasticsearch - ElasticSearch:我如何影响三元组匹配的“方向性”?