mirror of
https://github.com/apognu/tuigreet.git
synced 2024-09-11 07:25:29 +03:00
Short-circuit authentication if no command was configured (#140).
This commit is contained in:
parent
4ac12261cc
commit
e203bee7ec
@ -21,6 +21,7 @@ new_command = New command:
|
||||
shutdown = Shut down
|
||||
reboot = Reboot
|
||||
|
||||
command_missing = No command configured
|
||||
command_exited = Command exited with
|
||||
command_failed = Command failed
|
||||
|
||||
|
@ -21,6 +21,7 @@ command = Nouvelle commande :
|
||||
shutdown = Éteindre
|
||||
reboot = Redémarrer
|
||||
|
||||
command_missing = Aucune commande configurée
|
||||
command_exited = La commande a retourné
|
||||
command_failed = Échec de la commande
|
||||
|
||||
|
18
src/ipc.rs
18
src/ipc.rs
@ -148,9 +148,22 @@ impl Ipc {
|
||||
} else {
|
||||
tracing::info!("authentication successful, starting session");
|
||||
|
||||
let command = greeter.session_source.command(greeter).map(str::to_string);
|
||||
match greeter.session_source.command(greeter).map(str::to_string) {
|
||||
None => {
|
||||
Ipc::cancel(greeter).await;
|
||||
|
||||
if let Some(command) = command {
|
||||
greeter.message = Some(fl!("command_missing"));
|
||||
greeter.reset(false).await;
|
||||
}
|
||||
|
||||
Some(command) if command.is_empty() => {
|
||||
Ipc::cancel(greeter).await;
|
||||
|
||||
greeter.message = Some(fl!("command_missing"));
|
||||
greeter.reset(false).await;
|
||||
}
|
||||
|
||||
Some(command) => {
|
||||
greeter.done = true;
|
||||
greeter.mode = Mode::Processing;
|
||||
|
||||
@ -175,6 +188,7 @@ impl Ipc {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Response::Error { error_type, description } => {
|
||||
tracing::info!("received an error from greetd: {error_type:?} - {description}");
|
||||
|
Loading…
Reference in New Issue
Block a user