32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
import { Module } from "@nestjs/common";
|
|
import { JwtModule } from "@nestjs/jwt";
|
|
import { PassportModule } from "@nestjs/passport";
|
|
import { ConfigModule, ConfigService } from "@nestjs/config";
|
|
import { AuthController } from "./auth.controller";
|
|
import { AuthService } from "./auth.service";
|
|
import { JwtStrategy } from "./jwt.strategy";
|
|
import { WarehousesModule } from "../warehouses/warehouses.module";
|
|
import { NotificationsModule } from "../notifications/notifications.module";
|
|
import { IntegrationsModule } from "../integrations/integrations.module";
|
|
|
|
@Module({
|
|
imports: [
|
|
PassportModule,
|
|
JwtModule.registerAsync({
|
|
imports: [ConfigModule],
|
|
inject: [ConfigService],
|
|
useFactory: (config: ConfigService) => ({
|
|
secret: config.get<string>("JWT_SECRET", "change-me"),
|
|
signOptions: { expiresIn: config.get("JWT_EXPIRES_IN", "15m") },
|
|
}),
|
|
}),
|
|
WarehousesModule,
|
|
NotificationsModule,
|
|
IntegrationsModule,
|
|
],
|
|
controllers: [AuthController],
|
|
providers: [AuthService, JwtStrategy],
|
|
exports: [AuthService, JwtModule],
|
|
})
|
|
export class AuthModule {}
|