forget

tcmts.atproto.forget · #rbvyn5qp · function · runs in the browser

uses localStorage

Forget a sign-in in this browser (and on the app's server, if it told it), and say so.

import { ACCOUNT_EVENT, endSignIn, SIGNED_IN } from "#codebase/tcmts/atproto";
import type { Account, SignInOptions } from "#codebase/tcmts/atproto";

export async function forget(kept: Account & SignInOptions): Promise<void> {
  localStorage.removeItem(SIGNED_IN);
  if (kept.server) await endSignIn().catch(() => undefined);
  window.dispatchEvent(new Event(ACCOUNT_EVENT));
}

uses

used by