diff --git a/src/lightdm-deepin-greeter/greeterworker.cpp b/src/lightdm-deepin-greeter/greeterworker.cpp index 5ae3360b..a76e1c55 100644 --- a/src/lightdm-deepin-greeter/greeterworker.cpp +++ b/src/lightdm-deepin-greeter/greeterworker.cpp @@ -516,14 +516,6 @@ void GreeterWorker::checkAccount(const QString &account) const QString userPath = m_accountsInter->FindUserByName(account); if (userPath.startsWith("/")) { user_ptr = std::make_shared(userPath); - - // 对于没有设置密码的账户,直接认定为错误账户 - if (!user_ptr->isPasswordValid()) { - qWarning() << userPath; - emit m_model->authFailedTipsMessage(tr("Wrong account")); - m_model->setAuthType(AT_None); - return; - } } else if (!user_ptr) { // 判断账户第一次登录时的有效性 std::string str = account.toStdString(); @@ -556,6 +548,13 @@ void GreeterWorker::checkAccount(const QString &account) destroyAuthentication(m_account); createAuthentication(user_ptr->name()); } + // 对于没有设置密码的账户,直接认定为错误账户 + if (!user_ptr->isPasswordValid()) { + qWarning() << userPath; + emit m_model->authFailedTipsMessage(tr("Wrong account")); + m_model->setAuthType(AT_None); + return; + } } void GreeterWorker::checkDBusServer(bool isValid)