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

@orangecheck/auth-client


@orangecheck/auth-client / installTabFetchInterceptor

Function: installTabFetchInterceptor()

function installTabFetchInterceptor(authOrigin: string): () => void;

Defined in: tab-session.ts:108

Install a scoped window.fetch wrapper that attaches the tab pin to every same-site request, so app-level data fetches (vault shares, me wallet, fleet projects, …) execute as the account this tab displays — without touching any call site. Returns an uninstaller.

Conservative by design:

  • no pin → pass-through (zero behavior change)
  • only same-origin + auth-host URLs (see isPinnableUrl)
  • never overrides an existing Authorization or x-oc-tab-session header (programmatic Bearer / integrator-token paths keep their own credential semantics)
  • any internal error → original fetch, untouched

Parameters

ParameterType
authOriginstring

Returns

() => void