import { Module, forwardRef } from "@nestjs/common"; import { JwtModule } from "@nestjs/jwt"; import { PassportModule } from "@nestjs/passport"; import { AuthService } from "./auth.service"; import { AuthController } from "./auth.controller"; import { JwtStrategy } from "./jwt.strategy"; import { UsersModule } from "../users/users.module"; import { AdminModule } from "../admin/admin.module"; import { getJwtSecret } from "./auth.constants"; import { RedisModule } from "../redis/redis.module"; @Module({ imports: [ UsersModule, forwardRef(() => AdminModule), PassportModule, RedisModule, JwtModule.registerAsync({ useFactory: () => ({ secret: getJwtSecret(), signOptions: { expiresIn: "2h" }, }), }), ], controllers: [AuthController], providers: [AuthService, JwtStrategy], exports: [AuthService], }) export class AuthModule {}