From 1fe377f51442cd5ff5113147fd8451e749558689 Mon Sep 17 00:00:00 2001 From: Clombrong Date: Tue, 10 Jun 2025 17:59:04 +0200 Subject: feat(auth): introduce not-authorized sasl error --- lib/auth.ml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/auth.ml') diff --git a/lib/auth.ml b/lib/auth.ml index 75c2552..d97a8cb 100644 --- a/lib/auth.ml +++ b/lib/auth.ml @@ -1,5 +1,12 @@ type auth_mechanism = PLAIN [@@deriving show { with_path = false }] +type sasl_error = + | NotAuthorized + +let read_sasl_error = function + | "not-authorized" -> NotAuthorized + | _ -> failwith "Unsupported SASL error returned by the server." + let send_auth_stanza (stream, push) jid pass mechanism = let gen_auth = function | PLAIN -> Base64.encode_exn ("\x00" ^ jid ^ "\x00" ^ pass) -- cgit v1.2.3