diff --git a/src/collections/sanitize.js b/src/collections/sanitize.js index 9390d82026..95bf09abc3 100644 --- a/src/collections/sanitize.js +++ b/src/collections/sanitize.js @@ -229,6 +229,7 @@ const sanitizeCollection = (collections, collection) => { } if (collection.auth) { + if (collection.auth === true) sanitized.auth = {}; if (!sanitized.hooks.beforeLogin) sanitized.hooks.beforeLogin = []; if (!sanitized.hooks.afterLogin) sanitized.hooks.afterLogin = []; if (!collection.auth.forgotPassword) sanitized.auth.forgotPassword = {}; diff --git a/src/email/build.js b/src/email/build.js index 81fa5f2af2..e61afc4265 100644 --- a/src/email/build.js +++ b/src/email/build.js @@ -2,7 +2,7 @@ const nodemailer = require('nodemailer'); const mockHandler = require('./mockHandler'); async function buildEmail() { - if (this.config.email.transport === 'mock') { + if (!this.config.email || this.config.email.transport === 'mock') { const mockAccount = await mockHandler(this.config.email); return mockAccount; }