atproto/browser/oauth/tokens

Async mirror of atproto/oauth/tokens.gleam: refresh a verified session (same sub, same checks as the original exchange) and best-effort revocation. Code exchange lives in atproto/browser/oauth/flow.callback, behind the state and iss checks. A thin async wrapper over atproto_core/oauth/tokens.

Types

pub type TokenError =
  session.TokenError
pub type VerifiedSession =
  session.VerifiedSession

Values

pub fn refresh(
  client: xrpc.Client,
  session session: session.VerifiedSession,
  dpop_key dpop_key: dpop.DpopKey,
  client_auth client_auth: transport.ClientAuth,
) -> promise.Promise(
  Result(session.VerifiedSession, session.TokenError),
)
pub fn revoke(
  client: xrpc.Client,
  session session: session.VerifiedSession,
  dpop_key dpop_key: dpop.DpopKey,
  client_auth client_auth: transport.ClientAuth,
) -> promise.Promise(Nil)

Best-effort revocation at logout. Failures are ignored (the caller clears its local session regardless).

pub fn token_error_to_string(error: session.TokenError) -> String
✨ Search Document