Hi everyone! I want to create unit tests for my Nest.js API. In those tests, I want to test the endpoints that need authentication. I have made a test user and I just want to log that user in so I can use it’s token.
I already tried it with just logging in into my client application and copying the code but this is manual and I want it to be automated just in the unit tests itself.
I already looked at the Authentication API because I saw that I needed to follow this: (https://auth0.com/docs/api/authentication?javascript#resource-owner-password). But when I post the login request I get this error: Authorization server not configured with default connection. I also read that this resource-owner-password way of authenticating is not recommended. If so, how else can I test my API and provide the token of a test user?
If you need more information just let me know!