Enabling authentication

Be able to authenticate in the Swagger UI

The next improvement will be quite simple. We'll allow authentication in the Swagger UI, and also enable it for all the routes automatically. Let's then go back to the main file.

To enable authentication, add the following just before the setVersion() call.

.addBearerAuth()

And to enable it for all the routes, also add after it:

.addSecurityRequirements('bearer')

With this, we can access protected routes in the Swagger UI.

Commit - Enabling bearer auth in swagger

Last updated