authentication authorization
This commit is contained in:
@@ -7,6 +7,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';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule, process.env.GENERATE_OPENAPI ? { logger: false } : undefined);
|
||||
@@ -19,6 +22,12 @@ async function bootstrap() {
|
||||
}),
|
||||
);
|
||||
|
||||
app.useGlobalGuards(
|
||||
app.get(AuthenticationGuard),
|
||||
app.get(AuthorizationGuard),
|
||||
app.get(FeatureAvailabilityGuard),
|
||||
);
|
||||
|
||||
// Swagger/OpenAPI configuration
|
||||
const config = new DocumentBuilder()
|
||||
.setTitle('GridPilot API')
|
||||
|
||||
Reference in New Issue
Block a user