Skip to content

Commit

Permalink
refactor : auth모듈과 user모듈간 export, import 순환 의존성 해결 #35
Browse files Browse the repository at this point in the history
- forwardRef를 추가하여 잠재적 오류 가능성 해결.
  • Loading branch information
GeunH committed Nov 17, 2023
1 parent 91a04d8 commit a22262b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions be/src/auth/auth.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Module } from "@nestjs/common";
import { Module, forwardRef } from "@nestjs/common";
import { AuthController } from "./auth.controller";
import { AuthService } from "./auth.service";
import { JwtModule } from "@nestjs/jwt";
Expand All @@ -15,10 +15,10 @@ import { JwtStrategy } from "./strategy/jwt.strategy";
expiresIn: 3600,
},
}),
UserModule,
forwardRef(() => UserModule),
],
controllers: [AuthController],
providers: [AuthService, JwtStrategy],
exports: [PassportModule],
})
export class AuthModule {}
export class AuthModule { }
4 changes: 3 additions & 1 deletion be/src/user/user.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { Module } from "@nestjs/common";
import { UserController } from "./user.controller";
import { UserService } from "./user.service";
import { UserRepository } from "./user.repository";
import { AuthModule } from "src/auth/auth.module";

@Module({
imports: [AuthModule],
controllers: [UserController],
providers: [UserService, UserRepository],
exports: [UserRepository],
})
export class UserModule {}
export class UserModule { }

0 comments on commit a22262b

Please sign in to comment.