Skip to content

Commit

Permalink
fingerprint: add a delay after an unrecognized fingerprint (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueZeeKing authored Jan 1, 2025
1 parent a2f00fb commit e01afaf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/auth/Fingerprint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions src/config/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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{""});
Expand Down

0 comments on commit e01afaf

Please sign in to comment.