def sasl

bend-kit-postgres@0.3.0.0 · postgres.bend:313

import bend-kit-postgres@0.3.0.0/postgres.bend as Postgres
import Base
import bend-kit-postgres@0.3.0.0/scram.bend as Scram

313def sasl(ok: Bool, c: Conn, +user: String, +pass: String) -> IO(Result<&1, &1, Failure, Conn>):
314  match ok:
315    case True{}:
316      do IO<Result<&1, &1, Failure, Conn>>:
317        f : Result<&1, &1, U32 & String, Scram.First & String> <- Scram.first(user)
318        sasl.first(c, pass, f)
319    case False{}:
320      abort(Conn, c, Auth{"server offers no " ++ Scram.mechanism()})

Uses (15)

Used by (1)