Skip to content

Commit

Permalink
Revert conditionally clearing the password input buffer
Browse files Browse the repository at this point in the history
Makes sure the input field can show the fail text for fingerprint auth.
  • Loading branch information
PaideiaDilemma committed Dec 12, 2024
1 parent 5e14af7 commit 747eef6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions src/auth/Auth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,11 @@ void CAuth::terminate() {
}

static void passwordCheckTimerCallback(std::shared_ptr<CTimer> self, void* data) {
const auto PCLEAR = (bool*)data;
// check result
if (g_pAuth->isAuthenticated()) {
g_pHyprlock->unlock();
} else {
if (*PCLEAR)
g_pHyprlock->clearPasswordBuffer();

g_pHyprlock->clearPasswordBuffer();
g_pAuth->m_iFailedAttempts += 1;
Debug::log(LOG, "Failed attempts: {}", g_pAuth->m_iFailedAttempts);

Expand All @@ -118,8 +115,8 @@ static void passwordCheckTimerCallback(std::shared_ptr<CTimer> self, void* data)
}
}

void CAuth::enqueueCheckAuthenticated(bool clearPasswordBuffer) {
g_pHyprlock->addTimer(std::chrono::milliseconds(1), passwordCheckTimerCallback, new bool(clearPasswordBuffer));
void CAuth::enqueueCheckAuthenticated() {
g_pHyprlock->addTimer(std::chrono::milliseconds(1), passwordCheckTimerCallback, nullptr);
}

void CAuth::postActivity(eAuthImplementations implType) {
Expand Down
2 changes: 1 addition & 1 deletion src/auth/Auth.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class CAuth {
bool m_bDisplayFailText = false;
size_t m_iFailedAttempts = 0;

void enqueueCheckAuthenticated(bool clearPasswordBuffer = true);
void enqueueCheckAuthenticated();
void postActivity(eAuthImplementations implType);

private:
Expand Down

0 comments on commit 747eef6

Please sign in to comment.