support 2fa

This commit is contained in:
Kevin Yue 2021-11-15 11:37:46 +08:00
parent f1073676ab
commit 2831dbd98a
2 changed files with 2 additions and 1 deletions

View File

@ -36,4 +36,3 @@ void ChallengeDialog::on_challengeInput_textChanged(const QString &value)
okBtn->setEnabled(true); okBtn->setEnabled(true);
} }
} }

View File

@ -68,6 +68,7 @@ void GatewayAuthenticator::onLoginFinished()
// 2FA // 2FA
if (response.contains("Challenge")) { if (response.contains("Challenge")) {
PLOGI << "The server need input the challenge...";
showChallenge(response); showChallenge(response);
return; return;
} }
@ -206,6 +207,7 @@ void GatewayAuthenticator::showChallenge(const QString &responseText)
connect(challengeDialog, &ChallengeDialog::accepted, this, [this] { connect(challengeDialog, &ChallengeDialog::accepted, this, [this] {
params.setPassword(challengeDialog->getChallenge()); params.setPassword(challengeDialog->getChallenge());
PLOGI << "Challenge submitted, try to re-authenticate...";
authenticate(); authenticate();
}); });