[]previous and next page

CsrfContext

Inputs of checkCsrf that do not come from the request.

Inputs of checkCsrf that do not come from the request.

Import#

ts
import type { CsrfContext } from "@shadow-js/dusk/server";

Signature#

ts
interface CsrfContext {
  /** Origin the request is addressed to (`https://example.com`). */
  readonly origin: string;
  /** Extra allowed origins, already normalized (see {@link normalizeOrigins}). */
  readonly trustedOrigins: ReadonlySet<string>;
  /** Accept requests with no `Sec-Fetch-Site`, `Origin` or `Referer`. */
  readonly allowMissingOrigin: boolean;
}

Members#

Name Type Description
origin readonly origin: string Origin the request is addressed to (https://example.com).
trustedOrigins readonly trustedOrigins: ReadonlySet<string> Extra allowed origins, already normalized (see normalizeOrigins).
allowMissingOrigin readonly allowMissingOrigin: boolean Accept requests with no Sec-Fetch-Site, Origin or Referer.