diff --git a/i18n/en/cosmic_greeter.ftl b/i18n/en/cosmic_greeter.ftl index 69385a4..e819fac 100644 --- a/i18n/en/cosmic_greeter.ftl +++ b/i18n/en/cosmic_greeter.ftl @@ -5,3 +5,7 @@ restart-timeout = The system will restart automatically in {$seconds} seconds. shutdown = Shut down shutdown-now = Shut down now? shutdown-timeout = The system will shut down automatically in {$seconds} seconds. + +# Error messages +auth-failed = You entered an invalid password. +try-again = Please try again. diff --git a/src/greeter.rs b/src/greeter.rs index 6a65bf9..882ebd3 100644 --- a/src/greeter.rs +++ b/src/greeter.rs @@ -309,11 +309,17 @@ async fn request_message(socket: Arc, request: Request) -> Message { } }, Response::Error { - error_type: _, + error_type: error, description, } => { - //TODO: use error_type? - return Message::Error(socket, description); + log::error!("{error:?} => {description}"); + return match error { + greetd_ipc::ErrorType::AuthError => Message::Error( + socket, + format!("{} {}", fl!("auth-failed"), fl!("try-again")), + ), + greetd_ipc::ErrorType::Error => Message::Error(socket, description), + }; } Response::Success => match request { Request::CreateSession { .. } => {