fingerprint: add a delay after an unrecognized fingerprint (#625)

This commit is contained in:
Brayden Zee 2025-01-01 14:48:32 -06:00 committed by GitHub
parent a2f00fb735
commit e01afaf107
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View file

@ -169,7 +169,13 @@ void CFingerprint::handleVerifyStatus(const std::string& result, bool done) {
m_sFailureReason = "Fingerprint auth disabled (too many failed attempts)";
} else {
done = false;
startVerify(true);
static const auto RETRYDELAY = **(Hyprlang::INT* const*)(g_pConfigManager->getValuePtr("auth:fingerprint:retry_delay"));
g_pHyprlock->addTimer(
std::chrono::milliseconds(RETRYDELAY),
[](std::shared_ptr<CTimer> self, void* data) {
((CFingerprint*)data)->startVerify(true);
},
this);
}
break;
case MATCH_UNKNOWN_ERROR:

View file

@ -194,6 +194,7 @@ void CConfigManager::init() {
m_config.addConfigValue("auth:fingerprint:enabled", Hyprlang::INT{0});
m_config.addConfigValue("auth:fingerprint:ready_message", Hyprlang::STRING{"(Scan fingerprint to unlock)"});
m_config.addConfigValue("auth:fingerprint:present_message", Hyprlang::STRING{"Scanning fingerprint"});
m_config.addConfigValue("auth:fingerprint:retry_delay", Hyprlang::INT{250});
m_config.addSpecialCategory("background", Hyprlang::SSpecialCategoryOptions{.key = nullptr, .anonymousKeyBased = true});
m_config.addSpecialConfigValue("background", "monitor", Hyprlang::STRING{""});