import { Module } from "@nestjs/common"; import { PassportModule } from "@nestjs/passport"; import { APP_GUARD } from "@nestjs/core"; import { AuthFacade } from "./application/auth.facade.js"; import { AuthController } from "./presentation/http/auth.controller.js"; import { UsersModule } from "@bff/modules/users/users.module.js"; import { MappingsModule } from "@bff/modules/id-mappings/mappings.module.js"; import { IntegrationsModule } from "@bff/integrations/integrations.module.js"; import { JwtStrategy } from "./presentation/strategies/jwt.strategy.js"; import { LocalStrategy } from "./presentation/strategies/local.strategy.js"; import { GlobalAuthGuard } from "./presentation/http/guards/global-auth.guard.js"; import { TokenBlacklistService } from "./infra/token/token-blacklist.service.js"; import { EmailModule } from "@bff/infra/email/email.module.js"; import { CacheModule } from "@bff/infra/cache/cache.module.js"; import { AuthTokenService } from "./infra/token/token.service.js"; import { JoseJwtService } from "./infra/token/jose-jwt.service.js"; import { SignupWorkflowService } from "./infra/workflows/workflows/signup-workflow.service.js"; import { PasswordWorkflowService } from "./infra/workflows/workflows/password-workflow.service.js"; import { WhmcsLinkWorkflowService } from "./infra/workflows/workflows/whmcs-link-workflow.service.js"; import { FailedLoginThrottleGuard } from "./presentation/http/guards/failed-login-throttle.guard.js"; import { LoginResultInterceptor } from "./presentation/http/interceptors/login-result.interceptor.js"; import { AuthRateLimitService } from "./infra/rate-limiting/auth-rate-limit.service.js"; @Module({ imports: [ PassportModule, UsersModule, MappingsModule, IntegrationsModule, EmailModule, CacheModule, ], controllers: [AuthController], providers: [ AuthFacade, JwtStrategy, LocalStrategy, TokenBlacklistService, AuthTokenService, JoseJwtService, SignupWorkflowService, PasswordWorkflowService, WhmcsLinkWorkflowService, FailedLoginThrottleGuard, AuthRateLimitService, LoginResultInterceptor, { provide: APP_GUARD, useClass: GlobalAuthGuard, }, ], exports: [AuthFacade, TokenBlacklistService, AuthTokenService], }) export class AuthModule {}