import { forwardRef , Module } from '@nestjs/common' ; import { JwtModule } from '@nestjs/jwt' ; import { PassportModule } from '@nestjs/passport' ; import { ApiConfigService } from '../../shared/services/api-config.service' ; import { UserModule } from '../user/user.module' ; import { AuthController } from './auth.controller' ; import { AuthService } from './auth.service' ; import { JwtStrategy } from './jwt.strategy' ; import { PublicStrategy } from './public.strategy' ; @ Module ( { imports : [ forwardRef ( ( ) => UserModule ) , PassportModule . register ( { defaultStrategy : 'jwt' } ) , JwtModule . registerAsync ( { useFactory : ( configService ) => ( { secretOrPrivateKey : configService . authConfig . jwtSecret , } ) , inject : [ ApiConfigService ] , } ) , ] , controllers : [ AuthController ] , providers : [ AuthService , JwtStrategy , PublicStrategy ] , exports : [ JwtModule , AuthService ] , } ) export class AuthModule { }