Skip to content

Commit 591494c

Browse files
metsmamrts
authored andcommitted
Revert some changes to fix auth multiple cards
WE2-575 Signed-off-by: Raul Metsma <[email protected]>
1 parent cf4b145 commit 591494c

File tree

1 file changed

+28
-18
lines changed

1 file changed

+28
-18
lines changed

src/ui/webeiddialog.cpp

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -188,25 +188,35 @@ void WebEidDialog::onMultipleCertificatesReady(
188188
ui->selectCertificateOriginLabel->setText(fromPunycode(origin));
189189
setupCertificateAndPinInfo(certificateAndPinInfos);
190190

191-
if (CertificateButton* button =
192-
qobject_cast<CertificateButton*>(ui->selectionGroup->checkedButton())) {
193-
194-
switch (currentCommand) {
195-
case CommandType::GET_SIGNING_CERTIFICATE:
196-
setupOK([this, button] { emit accepted(button->certificateInfo()); });
197-
ui->pageStack->setCurrentIndex(int(Page::SELECT_CERTIFICATE));
198-
break;
199-
case CommandType::AUTHENTICATE:
191+
switch (currentCommand) {
192+
case CommandType::GET_SIGNING_CERTIFICATE:
193+
setupOK([this] {
194+
if (CertificateButton* button =
195+
qobject_cast<CertificateButton*>(ui->selectionGroup->checkedButton())) {
196+
197+
emit accepted(button->certificateInfo());
198+
} else {
199+
emit failure(QStringLiteral("CertificateButton not found"));
200+
}
201+
});
202+
ui->pageStack->setCurrentIndex(int(Page::SELECT_CERTIFICATE));
203+
break;
204+
case CommandType::AUTHENTICATE:
205+
setupOK([this, origin] {
200206
// Authenticate continues with the selected certificate to onSingleCertificateReady().
201-
onSingleCertificateReady(origin, button->certificateInfo());
202-
break;
203-
default:
204-
emit failure(QStringLiteral("Command %1 not allowed here")
205-
.arg(std::string(currentCommand).c_str()));
206-
return;
207-
}
208-
} else {
209-
emit failure(QStringLiteral("CertificateButton not found"));
207+
if (CertificateButton* button =
208+
qobject_cast<CertificateButton*>(ui->selectionGroup->checkedButton())) {
209+
210+
onSingleCertificateReady(origin, button->certificateInfo());
211+
} else {
212+
emit failure(QStringLiteral("CertificateButton not found"));
213+
}
214+
});
215+
ui->pageStack->setCurrentIndex(int(Page::SELECT_CERTIFICATE));
216+
break;
217+
default:
218+
emit failure(
219+
QStringLiteral("Command %1 not allowed here").arg(std::string(currentCommand).c_str()));
210220
}
211221
}
212222

0 commit comments

Comments
 (0)