qwen_2.5_model / src /modules /auth /auth.module.ts
Muhammad Noman
Deploy OpenWA to Hugging Face Spaces
46252cd
Raw
History Blame Contribute Delete
884 Bytes
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 {}