iya-sts
    Preparing search index...

    A browser's accounts: reading the list, the change signal, the control. A static utility class; it holds no state.

    Index
    ANOTHER_PARAM: "accounts" = 'accounts'
    ANOTHER_VALUE: "another" = 'another'
    ATTRIBUTE: "data-sts-accounts" = 'data-sts-accounts'
    CHANNEL: "sts-accounts" = 'sts-accounts'
    MESSAGE: "accounts-changed" = 'accounts-changed'
    PATH: "/authn-api/accounts" = '/authn-api/accounts'
    • The account action a click is on: a control carrying data-account-action, the target or one of its parents.

      Parameters

      • target: any

        the click's target

      Returns any

      { action, key }, or null

    • Whether the shell this page was drawn from says several accounts are on in its realm: <html data-sts-accounts="on">. Without it the list is never asked for.

      Parameters

      • env: any

        the browser's objects; its document is read

      Returns boolean

      whether the attribute says on

    • The address a sign-in as another account starts from: the user portal, asked to sign in again.

      Parameters

      • list: any

        the list, whose anotherAccount is the portal's address where the service named it (another listener, #472)

      Returns string

      the address; root-relative where the list named none, so the page's realm rewrite prefixes it

    • The live account a key is, in a list.

      Parameters

      • list: any

        the list

      • key: string

        the account's key

      Returns any

      the account, or null

    • The live account a subject is, in a list.

      Parameters

      • list: any

        the list

      • sub: string

        the subject

      Returns any

      the account, or null

    • Whether two lists say different things.

      Parameters

      • before: any

        the list in hand, or null

      • after: any

        the list just read

      Returns boolean

      whether they differ (never, where there was none before)

    • Draws the control a public surface carries: the signed-in accounts and Sign in with another account. Nothing where the list is off or holds no signed-in account.

      Parameters

      • list: any

        the list

      • t: any

        the page's translator (the accounts namespace loaded)

      Returns string

      the control's markup, or ''

    • Escapes text for HTML.

      Parameters

      • value: unknown

        anything

      Returns string

      the escaped text

    • Fetches the browser's accounts from this page's own origin.

      Parameters

      • env: any

        the browser's objects: fetch, location

      • prefix: string

        the realm's path prefix

      Returns Promise<any>

      the list, or OFF where it could not be read or is off

    • What a list says, as one string: two lists with the same accounts in the same states are the same, whatever order they came in.

      Parameters

      • list: any

        the list

      Returns string

      its fingerprint

    • The signed-in accounts of a list.

      Parameters

      • list: any

        the list

      Returns any[]

      the accounts whose state is signed-in

    • The name to show for an account.

      Parameters

      • one: any

        the account

      Returns string

      its display name, its username, or its subject

    • The list as OFF: what every page that could not read it draws from.

      Returns any

      { enabled: false, accounts: [] }

    • Opens the change signal: onChange is called for every message of this kind, and post() announces a change.

      Parameters

      • env: any

        the browser's objects: window.BroadcastChannel

      • onChange: () => void

        what a message makes this page do

      Returns any

      { post(change), close() }; both do nothing where the browser has no channel