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_type,
} => {
let answer = match auth_message_type {
AuthMessageType::Visible => prompt_stderr(&auth_message)?,
AuthMessageType::Secret => prompt_password_stderr(&auth_message)?,
let response = match auth_message_type {
AuthMessageType::Visible => Some(prompt_stderr(&auth_message)?),
AuthMessageType::Secret => Some(prompt_password_stderr(&auth_message)?),
AuthMessageType::Info => {
eprintln!("info: {}", auth_message);
"".to_string()
None
}
AuthMessageType::Error => {
eprintln!("error: {}", auth_message);
"".to_string()
None
}
};
next_request = Request::PostAuthMessageResponse {
response: Some(answer),
};
next_request = Request::PostAuthMessageResponse { response };
}
Response::Success => {
if starting {