FIX: add authentication to swagger

This commit is contained in:
Gabriel Rosa
2023-02-08 15:23:49 -03:00
parent cdba41dffa
commit 8043635b1c
9 changed files with 621 additions and 45 deletions
+5 -4
View File
@@ -46,10 +46,11 @@ function configureSwagger(app: INestApplication) {
const config = new DocumentBuilder()
.setTitle(swaggerTitle)
.setDescription('Documentation for Maestro gateway')
.addBearerAuth(
{ type: 'http', scheme: 'bearer', bearerFormat: 'JWT' },
'Authorization',
)
.addSecurity('access-token', {
type: 'apiKey',
name: 'Authorization',
in: 'header',
})
.build();
const document = SwaggerModule.createDocument(app, config);