actual pasword reasking on failed authentication
This commit is contained in:
parent
ce686e121b
commit
8f949277f6
13 changed files with 347 additions and 28 deletions
|
@ -76,16 +76,31 @@ void DialogQueue::performNextAction()
|
|||
case none:
|
||||
actionDone();
|
||||
break;
|
||||
case askPassword:
|
||||
prompt = new QInputDialog(squawk);
|
||||
connect(prompt, &QDialog::accepted, this, &DialogQueue::onPropmtAccepted);
|
||||
connect(prompt, &QDialog::rejected, this, &DialogQueue::onPropmtRejected);
|
||||
prompt->setInputMode(QInputDialog::TextInput);
|
||||
prompt->setTextEchoMode(QLineEdit::Password);
|
||||
prompt->setLabelText(tr("Input the password for account %1").arg(currentSource));
|
||||
prompt->setWindowTitle(tr("Password for account %1").arg(currentSource));
|
||||
prompt->setTextValue("");
|
||||
prompt->exec();
|
||||
case askPassword: {
|
||||
QInputDialog* dialog = new QInputDialog(squawk);
|
||||
prompt = dialog;
|
||||
connect(dialog, &QDialog::accepted, this, &DialogQueue::onPropmtAccepted);
|
||||
connect(dialog, &QDialog::rejected, this, &DialogQueue::onPropmtRejected);
|
||||
dialog->setInputMode(QInputDialog::TextInput);
|
||||
dialog->setTextEchoMode(QLineEdit::Password);
|
||||
dialog->setLabelText(tr("Input the password for account %1").arg(currentSource));
|
||||
dialog->setWindowTitle(tr("Password for account %1").arg(currentSource));
|
||||
dialog->setTextValue("");
|
||||
dialog->exec();
|
||||
}
|
||||
break;
|
||||
case askCredentials: {
|
||||
CredentialsPrompt* dialog = new CredentialsPrompt(squawk);
|
||||
prompt = dialog;
|
||||
connect(dialog, &QDialog::accepted, this, &DialogQueue::onPropmtAccepted);
|
||||
connect(dialog, &QDialog::rejected, this, &DialogQueue::onPropmtRejected);
|
||||
Models::Account* acc = squawk->rosterModel.getAccount(currentSource);
|
||||
dialog->setAccount(currentSource);
|
||||
dialog->setLogin(acc->getLogin());
|
||||
dialog->setPassword(acc->getPassword());
|
||||
dialog->exec();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -94,8 +109,18 @@ void DialogQueue::onPropmtAccepted()
|
|||
switch (currentAction) {
|
||||
case none:
|
||||
break;
|
||||
case askPassword:
|
||||
emit squawk->responsePassword(currentSource, prompt->textValue());
|
||||
case askPassword: {
|
||||
QInputDialog* dialog = static_cast<QInputDialog*>(prompt);
|
||||
emit squawk->responsePassword(currentSource, dialog->textValue());
|
||||
}
|
||||
break;
|
||||
case askCredentials: {
|
||||
CredentialsPrompt* dialog = static_cast<CredentialsPrompt*>(prompt);
|
||||
emit squawk->modifyAccountRequest(currentSource, {
|
||||
{"login", dialog->getLogin()},
|
||||
{"password", dialog->getPassword()}
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
actionDone();
|
||||
|
@ -107,6 +132,7 @@ void DialogQueue::onPropmtRejected()
|
|||
case none:
|
||||
break;
|
||||
case askPassword:
|
||||
case askCredentials:
|
||||
emit squawk->disconnectAccount(currentSource);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue