AuthModuleAsyncOptions
@noctcore/auth-nestjs: a NestJS module for @noctcore/auth.
AuthModule.forRoot/forRootAsyncprovide thecreateAuthresult underAUTH, registerSessionGuardglobally (closed by default,@Public()to open a route) and runCsrfMiddlewarebefore every route.@CurrentUser(),@CurrentSession()and@AuthMeta()read what the guard resolved;@RequireRole()and@RequireFreshAuth()narrow a route.SessionCookieswrites a new or ended session with its CSRF token.configureTrustProxyandtrustedHopsFromEnvreadTRUST_PROXYand refuse to start in production without it.describeRouteslists every route with its access rule, for a test.
Express is the supported platform, for HTTP controllers. GraphQL, WebSocket
and microservice handlers are refused unless @Public().
Extends
Section titled “Extends”Pick<ModuleMetadata,"imports">
Type Parameters
Section titled “Type Parameters”U extends AuthUser = AuthUser
Properties
Section titled “Properties”imports?
Section titled “imports?”
optionalimports?: (Type<any> |ForwardReference<any> |DynamicModule|Promise<DynamicModule>)[]
Optional list of imported modules that export the providers which are required in this module.
Inherited from
Section titled “Inherited from”Pick.imports
inject?
Section titled “inject?”
readonlyoptionalinject?: readonly (InjectionToken|OptionalFactoryDependency)[]
useFactory
Section titled “useFactory”
readonlyuseFactory: (…args) =>AuthModuleOptions<U> |Promise<AuthModuleOptions<U>>
Parameters
Section titled “Parameters”…never[]
Returns
Section titled “Returns”AuthModuleOptions<U> | Promise<AuthModuleOptions<U>>