35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
import { PersonaService } from './persona.service';
|
|
import { PersonaController } from './persona.controller';
|
|
import { PassportModule } from '@nestjs/passport';
|
|
import { ConfigModule, ConfigService } from '@nestjs/config';
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
import { JwtModule } from '@nestjs/jwt';
|
|
import { GoogleStrategy } from './google.strategy';
|
|
import { JwtStrategy } from './jwt.strategy';
|
|
import { Persona } from 'src/database/Monedero/entities/persona.entity';
|
|
import { AlumnoModule } from 'src/modules/AT/alumno/student.module';
|
|
|
|
@Module({
|
|
imports: [
|
|
TypeOrmModule.forFeature([Persona], 'dbMonedero'),
|
|
PassportModule.register({ defaultStrategy: 'jwt' }),
|
|
JwtModule.registerAsync({
|
|
imports: [ConfigModule],
|
|
inject: [ConfigService],
|
|
useFactory: async (configService: ConfigService) => {
|
|
return {
|
|
global: true,
|
|
secret: configService.get<string>('JWT_SECRET'),
|
|
signOptions: { expiresIn: '1h' },
|
|
};
|
|
},
|
|
}),
|
|
AlumnoModule,
|
|
],
|
|
controllers: [PersonaController],
|
|
providers: [PersonaService, GoogleStrategy, JwtStrategy],
|
|
exports: [PersonaService],
|
|
})
|
|
export class PersonaModule {}
|