import { Module } from '@nestjs/common' ; import { AuthService } from './auth.service' ; import { AuthController } from './auth.controller' ; import { UserHttpModule } from '../users/user-http.module' ; import { PassportModule } from '@nestjs/passport' ; import { LocalStrategy } from './strategies/local.strategy' ; import { JwtModule } from '@nestjs/jwt' ; import { JwtStrategy } from './strategies/jwt.strategy' ; import { ConfigModule , ConfigService } from '@nestjs/config' ; @ Module ( { imports : [ UserHttpModule , PassportModule , JwtModule . registerAsync ( { imports : [ ConfigModule ] , useFactory : async ( configService ) => ( { secret : configService . get < string > ( 'jwtSecretKey' ) , } ) , inject : [ ConfigService ] , } ) , ] , providers : [ AuthService , LocalStrategy , JwtStrategy ] , controllers : [ AuthController ] , } ) export class AuthModule { }