private function _loginByUsername ($username, $redirectMode = self::REDIRECT_MODE_SITE)
    {
        $craftUser = Craft::$app->users->getUserByUsernameOrEmail($username);

        if ( $craftUser ) {
            $success = Craft::$app->user->loginByUserId($craftUser->id);

            if ( $success ) {
                return $this->_afterLogin($redirectMode);
            }
        }
    }