Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions i18n/en/cosmic_greeter.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
12 changes: 9 additions & 3 deletions src/greeter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,17 @@ async fn request_message(socket: Arc<UnixStream>, 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 { .. } => {
Expand Down