mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Flag misconfigured project credentialSecret
This commit is contained in:
parent
33a5b84181
commit
05f90394db
@ -205,8 +205,16 @@ var api = module.exports = {
|
||||
var clearInvalidFlag = false;
|
||||
if (credentials.hasOwnProperty("$")) {
|
||||
if (encryptionEnabled === false) {
|
||||
// The credentials appear to be encrypted, but our config
|
||||
// thinks they are not.
|
||||
var error = new Error("Failed to decrypt credentials");
|
||||
error.code = "credentials_load_failed";
|
||||
if (activeProject) {
|
||||
// This is a project with a bad key. Mark it as invalid
|
||||
// TODO: this delves too deep into Project structure
|
||||
activeProject.credentialSecretInvalid = true;
|
||||
return when.reject(error);
|
||||
}
|
||||
return when.reject(error);
|
||||
}
|
||||
// These are encrypted credentials
|
||||
@ -219,7 +227,7 @@ var api = module.exports = {
|
||||
log.warn(log._("nodes.credentials.error",{message:err.toString()}))
|
||||
var error = new Error("Failed to decrypt credentials");
|
||||
error.code = "credentials_load_failed";
|
||||
if (projectKey) {
|
||||
if (activeProject) {
|
||||
// This is a project with a bad key. Mark it as invalid
|
||||
// TODO: this delves too deep into Project structure
|
||||
activeProject.credentialSecretInvalid = true;
|
||||
|
Loading…
Reference in New Issue
Block a user