live · mainnetoc · docs
specs · api · guides
docs / documentation

@orangecheck/ui


@orangecheck/ui / OcAccountMenuSession

Interface: OcAccountMenuSession

Defined in: account-menu.tsx:83

Minimal session shape <OcAccountMenuView> needs. Compatible with useOcSession()'s return value but explicit so consumers running their own auth context (e.g. oc-www's local useAuth) can pass an adapter without depending on @orangecheck/auth-client's exact types.

Properties

PropertyTypeDescriptionDefined in
<a id="property-account"></a> account| &#123; didOc: string; displayIdentity: DisplayIdentity; displayName: string | null; nostrNpub?: string | null; &#125; | null-account-menu.tsx:85
<a id="property-addaccounturl"></a> addAccountUrl?(returnTo?: string) => stringMulti-account · URL for the "add another account" entry point. Defaults to /signin?add=1 when omitted, which works for every .ochk.io family site (in-place sign-in supports the query param by default).account-menu.tsx:135
<a id="property-refresh"></a> refresh() => void | Promise&lt;void>-account-menu.tsx:106
<a id="property-roster"></a> roster?OcAccountSummary[]Multi-account roster · other accounts in this browser the user can switch to without re-authenticating. Optional: when omitted (or empty), the § accounts section in <OcAccountMenu> is suppressed and the menu renders as single-account. Sites that own their auth context (e.g. oc-www's local useAuth) can leave this unset until they add multi-account support.account-menu.tsx:122
<a id="property-setdisplayidentity"></a> setDisplayIdentity(kind: DisplayIdentityKind) => Promise&lt;void>Promote a linked identity to be the badge label across every .ochk.io site. The connected <OcAccountMenu> wires this to useOcSession().setDisplayIdentity; a site running its own auth context passes its own equivalent.account-menu.tsx:113
<a id="property-signout"></a> signOut(opts?: &#123; scope?: any; &#125;) => void | Promise&lt;void>Sign out. Accepts an optional { scope } so the multi-account "leave this account" affordance can route through the same hook. Defaults to 'all' for back-compat.account-menu.tsx:105
<a id="property-status"></a> status"loading" | "authenticated" | "anonymous" | "error"-account-menu.tsx:84
<a id="property-switchaccount"></a> switchAccount?(didOc: string) => Promise&lt;void>Multi-account · flip the active session to the given did_oc. Required when roster is non-empty (otherwise the picker rows have nowhere to call).account-menu.tsx:128