Skip to content

Commit

Permalink
core: don't auth on empty password (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
BranchManager authored Mar 4, 2024
1 parent 19d7844 commit 6a085d7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/hyprlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,9 +703,11 @@ void CHyprlock::onKey(uint32_t key, bool down) {
if (m_sPasswordState.passBuffer.length() > 0)
m_sPasswordState.passBuffer = m_sPasswordState.passBuffer.substr(0, m_sPasswordState.passBuffer.length() - 1);
} else if (SYM == XKB_KEY_Return || SYM == XKB_KEY_KP_Enter) {
Debug::log(LOG, "Authenticating");
if (m_sPasswordState.passBuffer.length() > 0) {
Debug::log(LOG, "Authenticating");

m_sPasswordState.result = g_pPassword->verify(m_sPasswordState.passBuffer);
m_sPasswordState.result = g_pPassword->verify(m_sPasswordState.passBuffer);
}
} else if (SYM == XKB_KEY_Escape) {
Debug::log(LOG, "Clearing password buffer");

Expand Down

0 comments on commit 6a085d7

Please sign in to comment.