core: don't auth on empty password (#126)

This commit is contained in:
BranchManager 2024-03-03 19:26:38 -05:00 committed by GitHub
parent 19d7844f04
commit 6a085d7f8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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");