From 53cdb11239f5cc79e82e50d6f8dc50bb6965ad6a Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 21 Sep 2019 11:02:03 -0400 Subject: [PATCH] fix: replace mail pass unless changed (#1053) --- server/graph/resolvers/mail.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/graph/resolvers/mail.js b/server/graph/resolvers/mail.js index 27b530b6..762b691f 100644 --- a/server/graph/resolvers/mail.js +++ b/server/graph/resolvers/mail.js @@ -12,7 +12,10 @@ module.exports = { }, MailQuery: { async config(obj, args, context, info) { - return WIKI.config.mail + return { + ...WIKI.config.mail, + pass: WIKI.config.mail.pass.length > 0 ? '********' : '' + } } }, MailMutation: { @@ -48,7 +51,7 @@ module.exports = { port: args.port, secure: args.secure, user: args.user, - pass: args.pass, + pass: (args.pass === '********') ? WIKI.config.mail.pass : args.pass, useDKIM: args.useDKIM, dkimDomainName: args.dkimDomainName, dkimKeySelector: args.dkimKeySelector,