aboutsummaryrefslogtreecommitdiff
path: root/lib/auth.ml
blob: 851db406c4625cc23583cbd314a5dcbfc4739e4d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
open Lwt.Syntax

type auth_mechanism = PLAIN  [@@deriving show]

let authenticate (stream, _push) =
  let _gen_auth jid pass = function
    | PLAIN -> Base64.encode_exn ("\x00" ^ jid ^ "\x00" ^ pass)
  in
  let+ features = Lwt_stream.get stream
  in Option.get features