auth.provider API
    Preparing search index...

    Function checkRequestOrigin

    • Classify a request's Origin — falling back to Referer — against the server's own origin and an explicit trust list.

      Behind a reverse proxy the server origin is only correct when the app sets trust proxy; req.protocol and req.host then read the forwarded values, which is what the browser actually put in Origin.

      A header that is present but does not parse — Origin: null from a sandboxed frame, a relative Referer — is foreign, not absent. Absent means the request carried no origin signal at all; a signal that fails to name this origin is not the same thing.

      Parameters

      • req: Request
      • trustedOrigins: readonly string[] = []

      Returns CsrfOriginVerdict