spotless

Values

pub fn authenticate(
  service: String,
  scope: List(String),
  state: String,
  port: Int,
  code_challenge_method: proof_key_for_code_exchange.CodeChallengeMethod,
  context: context.Context(a, b),
) -> fn(fn(Result(token.Response, String)) -> a) -> a

The authenticate function and therefore all named helpers builds upon the oauth_2_1.authorize function This use the task.Follow effect and keeps the process state in memory as a continuation. Keeping the state in memory is not possible if the state needs to be serialized in any way. For example a server that would keep code_verifier in a session cannot keep a gleam continuation in a session.

Instead use the _server function and use oauth_2_1.start

pub fn bsky(
  port: Int,
  scope: List(String),
  state: String,
  keypair: effect.KeyPair(a),
  context: context.Context(b, a),
) -> fn(fn(Result(token.Response, String)) -> b) -> b
pub fn dnsimple(
  port: Int,
  context: context.Context(a, b),
) -> fn(fn(Result(String, String)) -> a) -> a
pub fn dropbox(
  port: Int,
  scopes: List(String),
  context: context.Context(a, b),
) -> fn(fn(Result(String, String)) -> a) -> a
pub fn github(
  port: Int,
  scopes: List(String),
  context: context.Context(a, b),
) -> fn(fn(Result(String, String)) -> a) -> a
pub fn google(
  port: Int,
  scopes: List(String),
  context: context.Context(a, b),
) -> fn(fn(Result(String, String)) -> a) -> a
pub fn linkedin(
  port: Int,
  scopes: List(String),
  context: context.Context(a, b),
) -> fn(fn(Result(String, String)) -> a) -> a
pub fn netlify(
  port: Int,
  scopes: List(String),
  context: context.Context(a, b),
) -> fn(fn(Result(String, String)) -> a) -> a
pub fn server(
  service: String,
) -> Result(oauth_2_1.AuthorizationServer, Nil)
pub fn spotless_server(
  service: String,
) -> oauth_2_1.AuthorizationServer

The configuration of the public Spotless authorization server.

pub fn strava(
  port: Int,
  scopes: List(String),
  context: context.Context(a, b),
) -> fn(fn(Result(String, String)) -> a) -> a
pub fn twitter(
  port: Int,
  scopes: List(String),
  context: context.Context(a, b),
) -> fn(fn(Result(String, String)) -> a) -> a
pub fn vimeo(
  port: Int,
  scopes: List(String),
  context: context.Context(a, b),
) -> fn(fn(Result(String, String)) -> a) -> a
Search Document