fix: add logs for invalid api key

This commit is contained in:
Alexis Tyler
2021-05-12 07:26:47 +09:30
parent 93b75a5e4c
commit 3f9c083d3d
2 changed files with 15 additions and 7 deletions
+4 -2
View File
@@ -89,7 +89,8 @@ export class ApiManager extends EventEmitter {
// Update api manager with key
this.replace('upc', apiKey, {
// @todo: fix UPC being root
userId: '0'
userId: '0',
});
}
@@ -181,10 +182,11 @@ export class ApiManager extends EventEmitter {
const name = this.getNameFromKey(nameOrKey);
if (!name) {
log.debug('No key found for "%s".', nameOrKey);
return false;
}
// We still have to run the retrieve after finding the key
// We still have to use .get() after finding the key
// as this will run the cache validation check
// without this the key would be "valid" even after
// it's over the cache time