Entities created: - RefreshToken (auth.refresh_tokens) - SubscriptionItem (billing.subscription_items) - InvoiceItem (billing.invoice_items) - Payment (billing.payments) - FlagEvaluationRecord (feature_flags.evaluations) - PlanFeature (plans.plan_features) - TenantSetting (tenants.tenant_settings) Updated modules to register new entities. DDL-Entity coherence: 82.5% -> 100% Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
47 lines
1.5 KiB
TypeScript
47 lines
1.5 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
import { JwtModule } from '@nestjs/jwt';
|
|
import { PassportModule } from '@nestjs/passport';
|
|
import { ConfigModule, ConfigService } from '@nestjs/config';
|
|
|
|
// Entities
|
|
import { User, Session, Token, RefreshToken, OAuthConnection } from './entities';
|
|
|
|
// Services
|
|
import { AuthService } from './services/auth.service';
|
|
import { OAuthService } from './services/oauth.service';
|
|
import { MfaService } from './services/mfa.service';
|
|
|
|
// Controllers
|
|
import { AuthController } from './auth.controller';
|
|
import { OAuthController } from './controllers/oauth.controller';
|
|
|
|
// Strategies
|
|
import { JwtStrategy } from './strategies/jwt.strategy';
|
|
|
|
@Module({
|
|
imports: [
|
|
// Passport
|
|
PassportModule.register({ defaultStrategy: 'jwt' }),
|
|
|
|
// JWT
|
|
JwtModule.registerAsync({
|
|
imports: [ConfigModule],
|
|
useFactory: async (configService: ConfigService) => ({
|
|
secret: configService.get<string>('jwt.secret'),
|
|
signOptions: {
|
|
expiresIn: (configService.get<string>('jwt.expiresIn') || '15m') as any,
|
|
},
|
|
}),
|
|
inject: [ConfigService],
|
|
}),
|
|
|
|
// TypeORM entities
|
|
TypeOrmModule.forFeature([User, Session, Token, RefreshToken, OAuthConnection]),
|
|
],
|
|
controllers: [AuthController, OAuthController],
|
|
providers: [AuthService, OAuthService, MfaService, JwtStrategy],
|
|
exports: [AuthService, OAuthService, MfaService, JwtModule, PassportModule],
|
|
})
|
|
export class AuthModule {}
|