Files
flashcards-api/src/modules/auth/auth.module.ts
2023-06-16 12:01:14 +02:00

37 lines
1.0 KiB
TypeScript

import { Module } from '@nestjs/common'
import { AuthService } from './auth.service'
import { AuthController } from './auth.controller'
import { UsersModule } from '../users/users.module'
import { LocalStrategy } from './strategies/local.strategy'
import { CqrsModule } from '@nestjs/cqrs'
import {
CreateUserHandler,
GetCurrentUserDataHandler,
LogoutHandler,
RefreshTokenHandler,
ResendVerificationEmailHandler,
ResetPasswordHandler,
SendPasswordRecoveryEmailHandler,
VerifyEmailHandler,
} from './use-cases'
import { AuthRepository } from './infrastructure/auth.repository'
const commandHandlers = [
CreateUserHandler,
GetCurrentUserDataHandler,
LogoutHandler,
RefreshTokenHandler,
ResendVerificationEmailHandler,
ResetPasswordHandler,
SendPasswordRecoveryEmailHandler,
VerifyEmailHandler,
]
@Module({
imports: [UsersModule, CqrsModule],
controllers: [AuthController],
providers: [AuthService, LocalStrategy, AuthRepository, ...commandHandlers],
exports: [AuthService, CqrsModule],
})
export class AuthModule {}