property IRequest.user

The authenticated principal, populated by authentication middleware. Absent when the request is unauthenticated.

It accepts one implicit write per request; a second assignment throws so independent identity writers fail loudly. Use replacePrincipal for an intentional replacement such as step-up authentication. This is not an authorization control: a write before authentication is still the first write and is allowed.

Type

Usage

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