diff options
Diffstat (limited to 'lib/sasl.ml')
-rw-r--r-- | lib/sasl.ml | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/sasl.ml b/lib/sasl.ml index 3c2ae20..088543b 100644 --- a/lib/sasl.ml +++ b/lib/sasl.ml @@ -47,12 +47,9 @@ let send_auth_stanza (stream, push) localpart pass mechanism = `Text [gen_auth mechanism]; `End_element] in Markup.(stanza_list |> of_list |> write_xml |> to_string) |> Option.some |> push; - let* response = Lwt_stream.get stream - in try - match response with - | Some stanza -> parse_sasl_response stanza |> Lwt.return - | None -> Lwt.fail Stream.ClosedStream - with exn -> Lwt.fail exn + let* response = Stream.get stream + in try parse_sasl_response response |> Lwt.return + with exn -> Lwt.fail exn let authenticate (portal : Portal.t) (config : auth_config) = let {jid; password; _} = config |