function replaceTenant
Since 0.1.0
replaceTenant(
request: IRequest,
tenant: ITenant
): void

Replaces request.tenant deliberately, bypassing the single-write guard.

multi-tenancy-plugin's tenantMiddleware calls it, for the reason replacePrincipal documents. Safe to call on a request that was never sealed.

Parameters

request: IRequest

The request whose tenant is being replaced

tenant: ITenant

The tenant to install

Return Type

void

Usage

import { replaceTenant } from "common/src/index.ts";