signOut

tcmts.atproto.signOut · #4aqcfbst · function · runs in the browser

uses tcmts.atproto.session, which uses tcmts.atproto.keptAccount, which uses localStorage

Sign out of this browser: its session revoked at the PDS, forgotten here, and (if it told it) the app's server.

import { forget, keptAccount, session } from "#codebase/tcmts/atproto";

export async function signOut(): Promise<void> {
  const s = await session();
  if (s) await s.signOut();
  else {
    const kept = keptAccount();
    if (kept) await forget(kept);
  }
}

uses

used by