allows for auth to be specified as true with no options

This commit is contained in:
James
2020-10-17 15:08:39 -04:00
parent bb7a910377
commit 05a06a9aa8
2 changed files with 2 additions and 1 deletions

View File

@@ -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 = {};

View File

@@ -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;
}