27 lines
900 B
TypeScript
27 lines
900 B
TypeScript
|
|
import { Module } from '@nestjs/common';
|
||
|
|
import { PassportModule } from '@nestjs/passport';
|
||
|
|
import { UsuarioModule } from 'src/usuario/usuario.module';
|
||
|
|
import { AuthService } from './auth.service';
|
||
|
|
import { jwtStrategy } from './jwt.strategy';
|
||
|
|
import { AuthController } from './auth.controller';
|
||
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
||
|
|
import { Usuario } from 'src/usuario/usuario.entity';
|
||
|
|
import { UsuarioService } from 'src/usuario/usuario.service';
|
||
|
|
import { JwtModule } from '@nestjs/jwt';
|
||
|
|
import { jwtConstants } from './jwt.constants';
|
||
|
|
|
||
|
|
@Module({
|
||
|
|
imports: [
|
||
|
|
UsuarioModule,
|
||
|
|
PassportModule,
|
||
|
|
TypeOrmModule.forFeature([Usuario]),
|
||
|
|
JwtModule.register({
|
||
|
|
secret: jwtConstants.secret,
|
||
|
|
signOptions: { expiresIn: '5h' },
|
||
|
|
}),
|
||
|
|
],
|
||
|
|
providers: [AuthService, jwtStrategy, UsuarioService, jwtStrategy],
|
||
|
|
controllers: [AuthController],
|
||
|
|
})
|
||
|
|
export class AuthModule {}
|