Add support for 2FA on ely.by accounts (#64)
This commit is contained in:
parent
cc85b44ff2
commit
392822ec7a
@ -46,7 +46,7 @@ void ElybyStep::onAuthFailed() {
|
||||
// NOTE: soft error in the first step means 'offline'
|
||||
if(state == AccountTaskState::STATE_FAILED_SOFT) {
|
||||
state = AccountTaskState::STATE_OFFLINE;
|
||||
errorMessage = tr("Ely.by user authentication ended with a network error.");
|
||||
errorMessage = tr("Ely.by user authentication ended with a network error.\nIf you are using 2FA make sure to enter your auth code.");
|
||||
}
|
||||
emit finished(state, errorMessage);
|
||||
}
|
||||
|
@ -43,7 +43,12 @@ void ElybyLoginDialog::accept()
|
||||
|
||||
// Setup the login task and start it
|
||||
m_account = MinecraftAccount::createElyby(ui->userTextBox->text());
|
||||
m_loginTask = m_account->loginElyby(ui->passTextBox->text());
|
||||
if (ui->mfaTextBox->text().length() > 0) {
|
||||
m_loginTask = m_account->loginElyby(ui->passTextBox->text() + ':' + ui->mfaTextBox->text());
|
||||
}
|
||||
else {
|
||||
m_loginTask = m_account->loginElyby(ui->passTextBox->text());
|
||||
}
|
||||
connect(m_loginTask.get(), &Task::failed, this, &ElybyLoginDialog::onTaskFailed);
|
||||
connect(m_loginTask.get(), &Task::succeeded, this, &ElybyLoginDialog::onTaskSucceeded);
|
||||
connect(m_loginTask.get(), &Task::status, this, &ElybyLoginDialog::onTaskStatus);
|
||||
@ -55,6 +60,7 @@ void ElybyLoginDialog::setUserInputsEnabled(bool enable)
|
||||
{
|
||||
ui->userTextBox->setEnabled(enable);
|
||||
ui->passTextBox->setEnabled(enable);
|
||||
ui->mfaTextBox->setEnabled(enable);
|
||||
ui->buttonBox->setEnabled(enable);
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="mfaTextBox">
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::Password</enum>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>2FA Code (Optional)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
<property name="value">
|
||||
|
Loading…
Reference in New Issue
Block a user