Skip to content

Commit

Permalink
fix: login for nopasswdlogin users
Browse files Browse the repository at this point in the history
Password less users in the group nopasswdlogin was stuck in the login screen.

Log: fix login stuck for passwordless users in nopasswdlogin group
  • Loading branch information
openarun authored and kegechen committed Mar 8, 2024
1 parent caea540 commit a96acbe
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/lightdm-deepin-greeter/greeterworker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<NativeUser>(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();
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a96acbe

Please sign in to comment.