Hello,
I have created an application with Angular as Frontend and NestJs as Backend.
In Angular I have put the authentication button and it works correctly. When the user authenticates, the request to /token is made correctly and this value is used to add it to the headers that will make the requests to the NestJS API. It works correctly, however, when a new request is made to /token (for example when refreshing the page), when sending the token through the headers, I receive a 401 error from NestJS.
I have to say that NestJS uses Passport JWT as authentication strategy.
I have not been able to determine why it does not work on subsequent requests (but it does on the first one). Am I missing something?