ajuste no command
This commit is contained in:
@@ -6,20 +6,30 @@ import { JwtStrategy } from '../strategies/jwt-strategy';
|
||||
import { RedisModule } from 'src/core/configs/cache/redis.module';
|
||||
import { UsersModule } from '../users/users.module';
|
||||
import { AuthController } from './auth.controller';
|
||||
import { CqrsModule } from '@nestjs/cqrs';
|
||||
import { ConfigModule, ConfigService } from '@nestjs/config';
|
||||
import { AuthenticateUserHandler } from './authenticate-user.service';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
JwtModule.register({
|
||||
secret: '4557C0D7-DFB0-40DA-BF83-91A75103F7A9',
|
||||
signOptions: { expiresIn: '8h' },
|
||||
CqrsModule,
|
||||
ConfigModule,
|
||||
JwtModule.registerAsync({
|
||||
imports: [ConfigModule],
|
||||
useFactory: async (configService: ConfigService) => ({
|
||||
secret: configService.get<string>('JWT_SECRET'),
|
||||
signOptions: {
|
||||
expiresIn: configService.get<string>('JWT_EXPIRES_IN'),
|
||||
},
|
||||
}),
|
||||
inject: [ConfigService],
|
||||
}),
|
||||
PassportModule.register({ defaultStrategy: 'jwt' }),
|
||||
RedisModule,
|
||||
UsersModule,
|
||||
|
||||
],
|
||||
controllers: [AuthController],
|
||||
providers: [AuthService, JwtStrategy],
|
||||
providers: [AuthService, JwtStrategy, AuthenticateUserHandler],
|
||||
exports: [AuthService],
|
||||
})
|
||||
export class AuthModule {}
|
||||
|
||||
Reference in New Issue
Block a user