fix issues

This commit is contained in:
2026-01-01 16:32:06 +01:00
parent aee182b09e
commit 17d715f259
19 changed files with 1014 additions and 344 deletions

View File

@@ -6,6 +6,9 @@ import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { writeFileSync } from 'fs';
import { join } from 'path';
import { AppModule } from './app.module';
import { AuthenticationGuard } from './domain/auth/AuthenticationGuard';
import { AuthorizationGuard } from './domain/auth/AuthorizationGuard';
import { FeatureAvailabilityGuard } from './domain/policy/FeatureAvailabilityGuard';
import { getGenerateOpenapi } from './env';
async function bootstrap() {
@@ -35,16 +38,15 @@ async function bootstrap() {
}),
);
// Guards (commented out to isolate DI issue)
// try {
// const authGuard = app.get(AuthenticationGuard);
// const authzGuard = app.get(AuthorizationGuard);
// const featureGuard = app.get(FeatureAvailabilityGuard);
// app.useGlobalGuards(authGuard, authzGuard, featureGuard);
// } catch (error) {
// console.error('Failed to register guards:', error);
// throw error;
// }
try {
const authGuard = app.get(AuthenticationGuard);
const authzGuard = app.get(AuthorizationGuard);
const featureGuard = app.get(FeatureAvailabilityGuard);
app.useGlobalGuards(authGuard, authzGuard, featureGuard);
} catch (error) {
console.error('Failed to register guards:', error);
throw error;
}
// Swagger
const config = new DocumentBuilder()