From 11cc7f183a41be0a04e57ae80f4f826c658fe6d1 Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 20 Dec 2018 21:09:13 +0100 Subject: [PATCH] auth: add work-around for xmpp-parsers pickyness --- src/client/auth.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/auth.rs b/src/client/auth.rs index 51bcaa11..9a56d049 100644 --- a/src/client/auth.rs +++ b/src/client/auth.rs @@ -92,9 +92,11 @@ impl ClientAuth { Box::new(ok(stream)) } else if let Ok(failure) = Failure::try_from(stanza.clone()) { Box::new(err(Error::Auth(AuthError::Fail(failure.defined_condition)))) + } else if stanza.name() == "failure" { + // Workaround for https://gitlab.com/xmpp-rs/xmpp-parsers/merge_requests/1 + Box::new(err(Error::Auth(AuthError::Sasl("failure".to_string())))) } else { // ignore and loop - println!("Ignore: {:?}", stanza); Self::handle_challenge(stream, mechanism) } }