Oauth2.grant: def of bend-kit-oauth2@0.11.0.1 Import: import bend-kit-oauth2@0.11.0.1/oauth2.bend as Oauth2 Lines 181-188 of bend-kit-oauth2@0.11.0.1/oauth2.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-oauth2@0.11.0.1/oauth2.bend&start_line=181&end_line=188 import Base import bend-kit-hairpin@0.13.0.1/hairpin.bend as Hairpin import bend-kit-http@0.38.1.1/http.bend as Http import bend-kit-time@0.3.0.0/time.bend as Time # POST m to the token endpoint. Hairpin sends a POST once. def grant(h: Hairpin.Client, cfg: Config, m: Map<&2, String>, +old: String) -> IO(Hairpin.Client & Result<&1, &1, Err, Token>): Config{url, +id, +secret} = cfg do IO>: now : Time.Instant <- Time.now() x : Hairpin.Client & Result<&1, &1, Hairpin.Err, Http.Res> <- Hairpin.request(h, "POST", url, auth.headers(id, secret), Http.from_string(body(id, secret, m))) return grant.done(old, now, x) Uses (20): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Map https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=bend-kit-hairpin@0.13.0.1/hairpin.bend&name=Client https://jend.leeeet.dev/definition.txt?path=bend-kit-hairpin@0.13.0.1/hairpin.bend&name=Err https://jend.leeeet.dev/definition.txt?path=bend-kit-hairpin@0.13.0.1/hairpin.bend&name=request https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Res https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=from_string https://jend.leeeet.dev/definition.txt?path=bend-kit-oauth2@0.11.0.1/oauth2.bend&name=Config https://jend.leeeet.dev/definition.txt?path=bend-kit-oauth2@0.11.0.1/oauth2.bend&name=Err https://jend.leeeet.dev/definition.txt?path=bend-kit-oauth2@0.11.0.1/oauth2.bend&name=Token https://jend.leeeet.dev/definition.txt?path=bend-kit-oauth2@0.11.0.1/oauth2.bend&name=auth.headers https://jend.leeeet.dev/definition.txt?path=bend-kit-oauth2@0.11.0.1/oauth2.bend&name=body https://jend.leeeet.dev/definition.txt?path=bend-kit-oauth2@0.11.0.1/oauth2.bend&name=grant.done https://jend.leeeet.dev/definition.txt?path=bend-kit-time@0.3.0.0/time.bend&name=Instant https://jend.leeeet.dev/definition.txt?path=bend-kit-time@0.3.0.0/time.bend&name=now