Authentication OctoberCMS:如何连接/自定义后端身份验证表单和应用程序流的登录?

Authentication OctoberCMS:如何连接/自定义后端身份验证表单和应用程序流的登录?,authentication,octobercms,octobercms-backend,octobercms-plugins,Authentication,Octobercms,Octobercms Backend,Octobercms Plugins,我有一个特定的身份验证流,必须发生在我的OctoberCMS web应用程序的后端用户。该过程涉及两因素认证 最初,我想到直接侵入“backend.auth.extendSignenView”事件,直接使用Javascript更改登录表单,然后将表单操作设置为所需的路径 例如: Event::listen('backend.auth.extendSigninView', function($controller) { $controller->addJs('/plug

我有一个特定的身份验证流,必须发生在我的OctoberCMS web应用程序的后端用户。该过程涉及两因素认证

最初,我想到直接侵入“backend.auth.extendSignenView”事件,直接使用Javascript更改登录表单,然后将表单操作设置为所需的路径

例如:

   Event::listen('backend.auth.extendSigninView', function($controller) {
        $controller->addJs('/plugins/x/y/assets/z.js')
    });
这个想法对我来说似乎是“超级黑客”,所以我花了太多时间试图找到“正确的方式”来登录,但没有成功

我现在遇到了另一位程序员,他使用上面提到的“backend.auth.extendesigninview”允许JS重新绘制表单的方法发布了他们的想法


有人知道更好的方法吗?或者这是最好的方法吗?

这将允许您覆盖视图和控制器的路径。希望这有帮助!:

<?php


    \Backend\Controllers\Auth::extend(function (\Backend\Controllers\Auth $controller){
        $controller->layoutPath = ['$/author/plugin/loginscreen/layouts'];
        $controller->suppressLayout = true;
        $controller->addViewPath('$/author/plugin/loginscreen/controllers');
    });
?>

我会试试这个,谢谢!