src/controllers/LoginController.php
public function actionIndex()
    {
        // redirect logged in users
        if (!Yii::$app->adminuser->isGuest) {
            return $this->redirect(['/admin/default/index']);
        }
       
        $this->registerAsset(Login::class);
        
        $this->view->registerJs("$('#email').focus(); checkInputLabels();
        	observeLogin('#loginForm', '".Url::toAjax('admin/login/async')."', '".Url::toAjax('admin/login/async-token')."');
        ");
    
        UserOnline::clearList($this->module->userIdleTimeout);
        
        return $this->render('index');
    }
public function actionIndex()
    {
        // redirect logged in users
        if (!Yii::$app->adminuser->isGuest) {
            return $this->redirect(['/admin/default/index']);
        }
       
        $this->registerAsset(Login::class);
        
        $this->view->registerJs("$('#email').focus(); checkInputLabels();
        	observeLogin('#loginForm', '".Url::toAjax('admin/login/async')."', '".Url::toAjax('admin/login/async-token')."');
        ");
    
        UserOnline::clearList($this->module->userIdleTimeout);
        
        return $this->render('index');
    }
public function actionIndex ( ) { // redirect logged in users if ( ! Yii :: $ app -> adminuser -> isGuest ) { return $ this -> redirect ( [ '/admin/default/index' ] ) ; } $ this -> registerAsset ( Login :: class ) ; $ this -> view -> registerJs ( "$('#email').focus(); checkInputLabels();
        	observeLogin('#loginForm', '" . Url :: toAjax ( 'admin/login/async' ) . "', '" . Url :: toAjax ( 'admin/login/async-token' ) . "');
        " ) ; UserOnline :: clearList ( $ this -> module -> userIdleTimeout ) ; return $ this -> render ( 'index' ) ; }
Login Form.

This action renders and display the login form.

+ Single sign in runs {{luya\admin\controllers\LoginController::actionAsync()}}.
+ 2FA calls {{luya\admin\controllers\LoginController::actionAsyncToken()}} afterwards.

@return \yii\web\Response|string
Login Form .