fix issues
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user