allows for auth to be specified as true with no options
This commit is contained in:
@@ -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 = {};
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user