Files
pcpuma_unam_api/src/auth/auth.module.ts
T

30 lines
984 B
TypeScript
Raw Normal View History

2022-04-21 16:31:26 -05:00
import { Module } from '@nestjs/common';
2022-07-24 22:35:00 -05:00
import { ConfigService } from '@nestjs/config';
2022-04-21 16:31:26 -05:00
import { JwtModule } from '@nestjs/jwt';
import { AuthController } from './auth.controller';
import { AuthService } from './auth.service';
import { JwtStrategyService } from './strategy/jwt-strategy.service';
2022-07-04 14:37:56 -05:00
import { BcryptModule } from '../bcrypt/bcrypt.module';
2022-04-21 21:52:40 -05:00
import { ModuloModule } from '../modulo/modulo.module';
2022-04-21 20:33:05 -05:00
import { OperadorModule } from '../operador/operador.module';
import { UsuarioModule } from '../usuario/usuario.module';
2022-04-21 16:31:26 -05:00
@Module({
imports: [
2022-07-04 14:37:56 -05:00
BcryptModule,
2022-04-21 16:31:26 -05:00
JwtModule.registerAsync({
inject: [ConfigService],
2022-07-24 22:35:00 -05:00
useFactory: (configService: ConfigService) => ({
secret: configService.get<string>('AUTH_SECRETKEY'),
2022-07-26 11:48:43 -05:00
signOptions: { expiresIn: '10h' },
2022-07-24 22:35:00 -05:00
}),
2022-04-21 16:31:26 -05:00
}),
2022-04-21 21:52:40 -05:00
ModuloModule,
2022-04-21 20:33:05 -05:00
OperadorModule,
UsuarioModule,
2022-04-21 16:31:26 -05:00
],
controllers: [AuthController],
providers: [AuthService, JwtStrategyService],
})
export class AuthModule {}