import { Module } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt';
import { getAppConfig } from '../config/env';
import { MailerModule } from '../mailer/mailer.module';
import { AuthController } from './auth.controller';
import { AuthService } from './auth.service';

const config = getAppConfig();

@Module({
  imports: [
    MailerModule,
    JwtModule.register({
      secret: config.jwtSecret,
      signOptions: { expiresIn: config.jwtExpiresIn },
    }),
  ],
  controllers: [AuthController],
  providers: [AuthService],
  exports: [JwtModule, AuthService],
})
export class AuthModule {}
