2025-08-21 15:24:40 +09:00
|
|
|
import { Module } from "@nestjs/common";
|
2025-08-28 16:57:57 +09:00
|
|
|
import { APP_GUARD } from "@nestjs/core";
|
2026-01-19 11:25:30 +09:00
|
|
|
import { AuthOrchestrator } from "./application/auth-orchestrator.service.js";
|
2025-12-26 18:17:37 +09:00
|
|
|
import { AuthHealthService } from "./application/auth-health.service.js";
|
|
|
|
|
import { AuthLoginService } from "./application/auth-login.service.js";
|
2025-12-10 16:08:34 +09:00
|
|
|
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 { GlobalAuthGuard } from "./presentation/http/guards/global-auth.guard.js";
|
2026-01-19 10:40:50 +09:00
|
|
|
import { PermissionsGuard } from "./presentation/http/guards/permissions.guard.js";
|
2025-12-10 16:08:34 +09:00
|
|
|
import { TokenBlacklistService } from "./infra/token/token-blacklist.service.js";
|
2025-12-26 18:17:37 +09:00
|
|
|
import { TokenStorageService } from "./infra/token/token-storage.service.js";
|
|
|
|
|
import { TokenRevocationService } from "./infra/token/token-revocation.service.js";
|
2026-01-14 13:54:01 +09:00
|
|
|
import { PasswordResetTokenService } from "./infra/token/password-reset-token.service.js";
|
2025-12-10 16:08:34 +09:00
|
|
|
import { CacheModule } from "@bff/infra/cache/cache.module.js";
|
|
|
|
|
import { AuthTokenService } from "./infra/token/token.service.js";
|
2025-12-11 12:03:31 +09:00
|
|
|
import { JoseJwtService } from "./infra/token/jose-jwt.service.js";
|
2025-12-26 17:36:06 +09:00
|
|
|
import { PasswordWorkflowService } from "./infra/workflows/password-workflow.service.js";
|
|
|
|
|
import { WhmcsLinkWorkflowService } from "./infra/workflows/whmcs-link-workflow.service.js";
|
2025-12-10 16:08:34 +09:00
|
|
|
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";
|
2025-12-26 18:17:37 +09:00
|
|
|
import { SignupAccountResolverService } from "./infra/workflows/signup/signup-account-resolver.service.js";
|
|
|
|
|
import { SignupValidationService } from "./infra/workflows/signup/signup-validation.service.js";
|
|
|
|
|
import { SignupWhmcsService } from "./infra/workflows/signup/signup-whmcs.service.js";
|
|
|
|
|
import { SignupUserCreationService } from "./infra/workflows/signup/signup-user-creation.service.js";
|
2026-01-14 13:54:01 +09:00
|
|
|
// Get Started flow
|
|
|
|
|
import { OtpService } from "./infra/otp/otp.service.js";
|
|
|
|
|
import { GetStartedSessionService } from "./infra/otp/get-started-session.service.js";
|
2026-02-24 14:37:23 +09:00
|
|
|
import { GetStartedCoordinator } from "./infra/workflows/get-started-coordinator.service.js";
|
|
|
|
|
import { VerificationWorkflowService } from "./infra/workflows/verification-workflow.service.js";
|
|
|
|
|
import { GuestEligibilityWorkflowService } from "./infra/workflows/guest-eligibility-workflow.service.js";
|
|
|
|
|
import { NewCustomerSignupWorkflowService } from "./infra/workflows/new-customer-signup-workflow.service.js";
|
|
|
|
|
import { SfCompletionWorkflowService } from "./infra/workflows/sf-completion-workflow.service.js";
|
|
|
|
|
import { WhmcsMigrationWorkflowService } from "./infra/workflows/whmcs-migration-workflow.service.js";
|
|
|
|
|
import {
|
|
|
|
|
ResolveSalesforceAccountStep,
|
|
|
|
|
CreateWhmcsClientStep,
|
|
|
|
|
CreatePortalUserStep,
|
|
|
|
|
UpdateSalesforceFlagsStep,
|
|
|
|
|
GenerateAuthResultStep,
|
|
|
|
|
CreateEligibilityCaseStep,
|
|
|
|
|
} from "./infra/workflows/steps/index.js";
|
2026-01-14 13:54:01 +09:00
|
|
|
import { GetStartedController } from "./presentation/http/get-started.controller.js";
|
2026-01-15 18:15:51 +09:00
|
|
|
import { WorkflowModule } from "@bff/modules/shared/workflow/index.js";
|
2026-02-03 11:48:49 +09:00
|
|
|
// Login OTP flow
|
|
|
|
|
import { LoginSessionService } from "./infra/login/login-session.service.js";
|
|
|
|
|
import { LoginOtpWorkflowService } from "./infra/workflows/login-otp-workflow.service.js";
|
2026-02-03 19:21:48 +09:00
|
|
|
// Trusted device
|
|
|
|
|
import { TrustedDeviceService } from "./infra/trusted-device/trusted-device.service.js";
|
2025-08-20 18:02:50 +09:00
|
|
|
|
|
|
|
|
@Module({
|
2026-01-15 18:15:51 +09:00
|
|
|
imports: [UsersModule, MappingsModule, IntegrationsModule, CacheModule, WorkflowModule],
|
2026-01-14 13:54:01 +09:00
|
|
|
controllers: [AuthController, GetStartedController],
|
2025-08-28 16:57:57 +09:00
|
|
|
providers: [
|
2025-12-26 18:17:37 +09:00
|
|
|
// Application services
|
2026-01-19 11:25:30 +09:00
|
|
|
AuthOrchestrator,
|
2025-12-26 18:17:37 +09:00
|
|
|
AuthHealthService,
|
|
|
|
|
AuthLoginService,
|
|
|
|
|
// Token services
|
2025-08-28 16:57:57 +09:00
|
|
|
TokenBlacklistService,
|
2025-12-26 18:17:37 +09:00
|
|
|
TokenStorageService,
|
|
|
|
|
TokenRevocationService,
|
2025-09-18 17:49:43 +09:00
|
|
|
AuthTokenService,
|
2025-12-11 12:03:31 +09:00
|
|
|
JoseJwtService,
|
2026-01-14 13:54:01 +09:00
|
|
|
PasswordResetTokenService,
|
2026-02-24 14:37:23 +09:00
|
|
|
// Signup shared services (reused by get-started workflows)
|
2025-12-26 18:17:37 +09:00
|
|
|
SignupAccountResolverService,
|
|
|
|
|
SignupValidationService,
|
|
|
|
|
SignupWhmcsService,
|
|
|
|
|
SignupUserCreationService,
|
|
|
|
|
// Other workflow services
|
2025-09-18 17:49:43 +09:00
|
|
|
PasswordWorkflowService,
|
|
|
|
|
WhmcsLinkWorkflowService,
|
2026-01-14 13:54:01 +09:00
|
|
|
// Get Started flow services
|
|
|
|
|
OtpService,
|
|
|
|
|
GetStartedSessionService,
|
2026-02-24 14:37:23 +09:00
|
|
|
GetStartedCoordinator,
|
|
|
|
|
VerificationWorkflowService,
|
|
|
|
|
GuestEligibilityWorkflowService,
|
|
|
|
|
NewCustomerSignupWorkflowService,
|
|
|
|
|
SfCompletionWorkflowService,
|
|
|
|
|
WhmcsMigrationWorkflowService,
|
|
|
|
|
// Shared step services
|
|
|
|
|
ResolveSalesforceAccountStep,
|
|
|
|
|
CreateWhmcsClientStep,
|
|
|
|
|
CreatePortalUserStep,
|
|
|
|
|
UpdateSalesforceFlagsStep,
|
|
|
|
|
GenerateAuthResultStep,
|
|
|
|
|
CreateEligibilityCaseStep,
|
2026-02-03 11:48:49 +09:00
|
|
|
// Login OTP flow services
|
|
|
|
|
LoginSessionService,
|
|
|
|
|
LoginOtpWorkflowService,
|
2026-02-03 19:21:48 +09:00
|
|
|
// Trusted device
|
|
|
|
|
TrustedDeviceService,
|
2025-12-26 18:17:37 +09:00
|
|
|
// Guards and interceptors
|
2025-09-27 17:51:54 +09:00
|
|
|
FailedLoginThrottleGuard,
|
2025-10-02 14:16:46 +09:00
|
|
|
AuthRateLimitService,
|
2025-09-27 17:51:54 +09:00
|
|
|
LoginResultInterceptor,
|
2026-01-19 14:15:43 +09:00
|
|
|
PermissionsGuard,
|
2025-08-28 16:57:57 +09:00
|
|
|
{
|
|
|
|
|
provide: APP_GUARD,
|
|
|
|
|
useClass: GlobalAuthGuard,
|
|
|
|
|
},
|
2026-01-19 10:40:50 +09:00
|
|
|
{
|
|
|
|
|
provide: APP_GUARD,
|
|
|
|
|
useClass: PermissionsGuard,
|
|
|
|
|
},
|
2025-08-28 16:57:57 +09:00
|
|
|
],
|
2026-01-19 11:25:30 +09:00
|
|
|
exports: [AuthOrchestrator, TokenBlacklistService, AuthTokenService, PermissionsGuard],
|
2025-08-20 18:02:50 +09:00
|
|
|
})
|
|
|
|
|
export class AuthModule {}
|