first commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { DynamicModule, Module, Type } from '@nestjs/common';
|
||||
import { APP_GUARD } from '@nestjs/core';
|
||||
import { AuthGuard } from './auth/auth.guard';
|
||||
import { WsAuthenticator } from './auth/ws-authenticator';
|
||||
import { UserResolver } from './graphql/user.resolver';
|
||||
import { AuthController } from './http/auth.controller';
|
||||
import { PireonWebhookController } from './http/pireon-webhook.controller';
|
||||
|
||||
/** Driving adapters of the identity context: global auth guard, webhook, GraphQL. */
|
||||
@Module({
|
||||
controllers: [AuthController, PireonWebhookController],
|
||||
providers: [
|
||||
{ provide: APP_GUARD, useClass: AuthGuard },
|
||||
WsAuthenticator,
|
||||
UserResolver,
|
||||
],
|
||||
exports: [WsAuthenticator],
|
||||
})
|
||||
export class IdentityPresentersModule {
|
||||
static withApplication(
|
||||
applicationModule: Type | DynamicModule,
|
||||
): DynamicModule {
|
||||
return {
|
||||
module: IdentityPresentersModule,
|
||||
imports: [applicationModule],
|
||||
exports: [WsAuthenticator],
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user