agreety: Post None answer on Info/Error

This commit is contained in:
Kenny Levinsen
2020-04-04 17:14:40 +02:00
parent 0c74e046ca
commit 4c0f5fd051

View File

@@ -73,22 +73,20 @@ fn login(node: &str, cmd: &mut Option<String>) -> Result<LoginResult, Box<dyn st
auth_message, auth_message,
auth_message_type, auth_message_type,
} => { } => {
let answer = match auth_message_type { let response = match auth_message_type {
AuthMessageType::Visible => prompt_stderr(&auth_message)?, AuthMessageType::Visible => Some(prompt_stderr(&auth_message)?),
AuthMessageType::Secret => prompt_password_stderr(&auth_message)?, AuthMessageType::Secret => Some(prompt_password_stderr(&auth_message)?),
AuthMessageType::Info => { AuthMessageType::Info => {
eprintln!("info: {}", auth_message); eprintln!("info: {}", auth_message);
"".to_string() None
} }
AuthMessageType::Error => { AuthMessageType::Error => {
eprintln!("error: {}", auth_message); eprintln!("error: {}", auth_message);
"".to_string() None
} }
}; };
next_request = Request::PostAuthMessageResponse { next_request = Request::PostAuthMessageResponse { response };
response: Some(answer),
};
} }
Response::Success => { Response::Success => {
if starting { if starting {