Note: This error is only occurring on the test server. Locally, everything works fine. The code both on the app-side and the library side are identical between servers.
When using the management app to replace API keys, if an invalid password is given, it is expected that the call to apiKeyService.generate will give an 'Authorization Required' due to the fact that an invalid password was used to create the apiKeyService instance. This successfully happens on my local server. However, on the test server, no error is returned by the call to apiKeyService.generate. Instead, 'err' is undefined, so the management app acts as if there was no error, even though an invalid password was given. I have tailed the logs on the test server to confirm that 'err' is undefined.
I know what it is. Although, we can workaround by patching the nodejs library, I think I am going to fix the real issue in the platform.
adds test for #2
Closed along with buglabs/bugswarm#91