'Jhipster swagger always showing unauthorised in prod environment

I am always getting unauthorised while trying to access swagger API documentation in jhipster. I am already logged in and I am able to access the API using the entities menu.

The issue is only in prod environment. It works fine in local environment. The issue raised after upgrading the applications (gateway and APIs) from jhipster version 7.4

tried disabling the api-docs under springdoc but no change

API page enter image description here

Network Calls Network calls



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source