1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Fix code not to change settings.adminAuth

This commit is contained in:
Hideki Nakamura 2018-09-17 10:18:36 -07:00
parent c102828a99
commit 716aa74004

View File

@ -40,7 +40,7 @@ function init(runtime) {
settings = runtime.settings; settings = runtime.settings;
log = runtime.log; log = runtime.log;
if (settings.adminAuth) { if (settings.adminAuth) {
var mergedAdminAuth = Object.assign(settings.adminAuth, settings.adminAuth.module); var mergedAdminAuth = Object.assign({}, settings.adminAuth, settings.adminAuth.module);
Users.init(mergedAdminAuth); Users.init(mergedAdminAuth);
Tokens.init(mergedAdminAuth,runtime.storage); Tokens.init(mergedAdminAuth,runtime.storage);
strategies.init(runtime); strategies.init(runtime);
@ -82,7 +82,7 @@ function getToken(req,res,next) {
function login(req,res) { function login(req,res) {
var response = {}; var response = {};
if (settings.adminAuth) { if (settings.adminAuth) {
var mergedAdminAuth = Object.assign(settings.adminAuth, settings.adminAuth.module); var mergedAdminAuth = Object.assign({}, settings.adminAuth, settings.adminAuth.module);
if (mergedAdminAuth.type === "credentials") { if (mergedAdminAuth.type === "credentials") {
response = { response = {
"type":"credentials", "type":"credentials",