Auth0 with next.js is not working with nest.js

Hi @nicolatesla0987,

Welcome to the Auth0 Community!

The 401 error you encountered typically means that the access token is missing, invalid, or malformed. In this case, it looks like the front end may not be getting a JWT access token because no audience is specified.

To ensure it’s a JWT access token, add one of your API identifiers as the audience for the authorization parameters.

(Reference: https://auth0.com/docs/secure/tokens/access-tokens/get-access-tokens#control-access-token-audience)

After doing so, the access token will be a JWT, and your backend will be able to validate it.

Let me know how this goes for you.

Thanks,
Rueben