Skip to content

Commit

Permalink
Fall back to normal unlock if quick unlock fails
Browse files Browse the repository at this point in the history
This commit resets the quick unlock state if quick unlock fails,
providing a better fallback behavior in the case of #7890 (the case
where Windows Hello suddenly becomes unavailable).
  • Loading branch information
Gibstick committed Jan 19, 2023
1 parent 80d88af commit 8414b14
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/gui/DatabaseOpenWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,18 +339,18 @@ QSharedPointer<CompositeKey> DatabaseOpenWidget::buildDatabaseKey()
// try to retrieve the stored password using Windows Hello
QByteArray keyData;
#ifdef Q_CC_MSVC
if (!getWindowsHello()->getKey(m_filename, keyData)) {
// Failed to retrieve Quick Unlock data
m_ui->messageWidget->showMessage(tr("Failed to authenticate with Windows Hello"), MessageWidget::Error);
return {};
}
const auto keyDataOk = getWindowsHello()->getKey(m_filename, keyData);
const auto errorString = tr("Failed to authenticate with Windows Hello");
#elif defined(Q_OS_MACOS)
if (!TouchID::getInstance().getKey(m_filename, keyData)) {
const auto keyDataOk = TouchID::getInstance().getKey(m_filename, keyData);
const auto errorString = tr("Failed to authenticate with Touch ID");
#endif
if (!keyDataOk) {
// Failed to retrieve Quick Unlock data
m_ui->messageWidget->showMessage(tr("Failed to authenticate with Touch ID"), MessageWidget::Error);
m_ui->messageWidget->showMessage(errorString, MessageWidget::Error);
resetQuickUnlock();
return {};
}
#endif
databaseKey->setRawKey(keyData);
return databaseKey;
}
Expand Down

0 comments on commit 8414b14

Please sign in to comment.