AuthModuleOptions
Type Parameters
Section titled “Type Parameters”U extends AuthUser = AuthUser
Properties
Section titled “Properties”
readonlyauth:NestAuth<U>
The createAuth(...) result.
clientIpHeader?
Section titled “clientIpHeader?”
readonlyoptionalclientIpHeader?:string
A single-address header your edge sets, such as cf-connecting-ip.
Needs trustedHops as a list naming the edge (or hops that accept
traffic only from it); read only when the socket address is inside that
list and the value is exactly one IP, otherwise X-Forwarded-For
decides. Off by default.
readonlycsrf:CsrfOptions
roles?
Section titled “roles?”
readonlyoptionalroles?: (user) => readonlystring[] |Promise<readonlystring[]>
The user’s roles, for @RequireRole(). Called on every request that
needs a role, with the user just loaded from the store, so a role change
takes effect on the next request.
Parameters
Section titled “Parameters”U
Returns
Section titled “Returns”readonly string[] | Promise<readonly string[]>
shutdownTimeout?
Section titled “shutdownTimeout?”
readonlyoptionalshutdownTimeout?:Duration
How long shutdown waits for background work (mail sends) before it gives
up, logs what it left running and lets the app close. Default '10s'.
touch?
Section titled “touch?”
readonlyoptionaltouch?:boolean| ((request) =>boolean)
Whether a request counts as activity for the session’s idle timeout.
true (the default) refreshes the session’s last-active time, at most
once per touchInterval, on every request. A predicate decides per
request, before the session is validated: return false for traffic the
page makes on its own (a poll on a timer, a status check), so an idle
session still expires while only such requests arrive. false touches
on no request. A passive request is still answered with its session,
and the CSRF checks and the guard’s decisions do not change.
trustedHops
Section titled “trustedHops”
readonlytrustedHops:TrustedHops
How many reverse proxies sit in front of the app, counted from the right
of X-Forwarded-For (see trustedHopsFromEnv), 0 when none; or a list
of proxy addresses, CIDR ranges and the presets loopback, linklocal
and uniquelocal, trusted by the socket address.