diff --git a/components/admin/Settings.vue b/components/admin/Settings.vue index 0a084508..15b3ab32 100644 --- a/components/admin/Settings.vue +++ b/components/admin/Settings.vue @@ -83,7 +83,7 @@ export default { computed: { ...mapState(['settings']), showSMTPAlert () { - return !this.setup && (!this.settings.admin_email || !this.settings.smtp || !this.settings.smtp.host || !this.settings.smtp.user) + return !this.setup && (!this.settings.admin_email || !this.settings.smtp || !this.settings.smtp.host || !this.settings.smtp.auth.user) }, instance_locale: { get () { return this.settings.instance_locale }, diff --git a/server/helpers.js b/server/helpers.js index 8b7fbb86..048a0914 100644 --- a/server/helpers.js +++ b/server/helpers.js @@ -65,6 +65,13 @@ module.exports = { // initialize settings req.settings = { ...settingsController.settings } + if (req.settings.smtp && req.settings.smtp.auth && req.settings.smtp.auth.pass) { + if (req.user.is_admin) { + delete req.settings.smtp.auth.pass + } else { + delete req.settings.smtp + } + } req.settings.baseurl = config.baseurl req.settings.hostname = config.hostname req.settings.title = req.settings.title || config.title