Spaces:
Runtime error
Runtime error
File size: 884 Bytes
46252cd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | import { Module, Global } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { APP_GUARD } from '@nestjs/core';
import { ApiKey } from './entities/api-key.entity';
import { AuthService } from './auth.service';
import { AuthController } from './auth.controller';
import { AuthValidateController } from './auth-validate.controller';
import { ApiKeyGuard } from './guards/api-key.guard';
import { ProxyAwareThrottlerGuard } from '../../common/security/proxy-aware-throttler.guard';
@Global()
@Module({
imports: [TypeOrmModule.forFeature([ApiKey], 'main')],
controllers: [AuthController, AuthValidateController],
providers: [
AuthService,
{
provide: APP_GUARD,
useClass: ProxyAwareThrottlerGuard,
},
{
provide: APP_GUARD,
useClass: ApiKeyGuard,
},
],
exports: [AuthService],
})
export class AuthModule {}
|