fix: ignore empty responses on the login screen

Message::Auth is constructed in exactly one place, the .on_submit of the
password input, and it forwards whatever the field holds to greetd. An
empty field therefore sends PostAuthMessageResponse with response
Some(""), PAM rejects it, and greetd tears the session down; the greeter
then reconnects with a fresh CreateSession. Every stray Enter costs that
round trip, and while it runs the user is looking at the authenticating
spinner.

Non-interactive auth messages (AuthMessageType::Info) are acknowledged
separately with response None and never reach Message::Auth, so an empty
Some can only come from the user submitting an empty field.

This is the login-screen counterpart of the lock-screen fix in #509. The
two do not overlap; that one guards Message::Submit in locker.rs.

Drafted with AI assistance (Claude Code); the change was reviewed, built
and tested by me as described.

Signed-off-by: chris-010 <10660568+chris-010@users.noreply.github.com>
This commit is contained in:
chris-010 2026-08-17 11:53:41 +02:00 • committed by Michael Murphy
parent ae627ab0d0
commit 088f26cbb8

View file

@ -1486,6 +1486,9 @@ impl cosmic::Application for App {
}
}
Message::Auth(response) => {
if response.as_deref() == Some("") {
return Task::none();
}
self.common.error_opt = None;
self.authenticating = true;
self.send_request(Request::PostAuthMessageResponse { response });