Check for missing encrypted credentials

pull/3498/head
Sam Machin 2022-03-19 13:34:46 +00:00
parent 49e69a54bd
commit 4d048af384
No known key found for this signature in database
GPG Key ID: C77A61AE4B88F6C3
1 changed files with 10 additions and 1 deletions

View File

@ -239,7 +239,16 @@ var api = module.exports = {
throw error;
}
} else {
credentialCache = credentials;
if (encryptionEnabled) {
// Our config expects the credentials to be encrypted but the encrypted object is not found
var error = new Error("Encrypted credentials not found");
error.code = "credentials_load_failed";
throw error
} else {
// credentialSecret is set to False
log.warn("Using Unecrypted credentials")
credentialCache = credentials;
}
}
if (clearInvalidFlag) {
// TODO: this delves too deep into Project structure