import { Module } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt';
import { PassportModule } from '@nestjs/passport';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AuthController } from './auth.controller';
import { AuthService } from './auth.service';
import { JwtStrategy } from './jwt.strategy';
import { Usuario } from '../users/entities/usuario.entity';
import { Perfil } from '../users/entities/perfil.entity';

@Module({
  imports: [
    TypeOrmModule.forFeature([Usuario, Perfil]),
    PassportModule,
    JwtModule.register({
      secret: 'hefesto-jwt-secret-2026',
      signOptions: { expiresIn: '24h' },
    }),
  ],
  controllers: [AuthController],
  providers: [AuthService, JwtStrategy],
  exports: [AuthService, JwtModule],
})
export class AuthModule {}
