Fix multiple TOTP issues

* Fix #9847 - don't provide TOTP values if settings are blank or completely wrong
* Fix #6838 - don't reset the ui when creating a new entry and applying TOTP to it
* Move totp source into the core folder
This commit is contained in:
Jonathan White 2023-10-23 23:22:12 -04:00
parent 5d64292ed8
commit 9f3b4dc5ea
16 changed files with 52 additions and 17 deletions

View file

@ -497,6 +497,10 @@ void DatabaseWidget::setupTotp()
auto setupTotpDialog = new TotpSetupDialog(this, currentEntry);
connect(setupTotpDialog, SIGNAL(totpUpdated()), SIGNAL(entrySelectionChanged()));
if (currentWidget() == m_editEntryWidget) {
// Entry is being edited, tell it when we are finished updating TOTP
connect(setupTotpDialog, SIGNAL(totpUpdated()), m_editEntryWidget, SLOT(updateTotp()));
}
connect(this, &DatabaseWidget::databaseLockRequested, setupTotpDialog, &TotpSetupDialog::close);
setupTotpDialog->open();
}