Refactor email enabled function

This commit is contained in:
Chocobozzz 2020-02-17 10:27:00 +01:00
parent 45f1bd72a0
commit 4c1c170934
No known key found for this signature in database
GPG key ID: 583A612D890159BE
11 changed files with 37 additions and 47 deletions

View file

@ -4,13 +4,12 @@ import { UserModel } from '../models/account/user'
import { ApplicationModel } from '../models/application/application'
import { OAuthClientModel } from '../models/oauth/oauth-client'
import { URL } from 'url'
import { CONFIG } from './config'
import { CONFIG, isEmailEnabled } from './config'
import { logger } from '../helpers/logger'
import { getServerActor } from '../helpers/utils'
import { RecentlyAddedStrategy } from '../../shared/models/redundancy'
import { isArray } from '../helpers/custom-validators/misc'
import { uniq } from 'lodash'
import { Emailer } from '../lib/emailer'
import { WEBSERVER } from './constants'
async function checkActivityPubUrls () {
@ -41,7 +40,7 @@ function checkConfig () {
}
// Email verification
if (!Emailer.isEnabled()) {
if (!isEmailEnabled()) {
if (CONFIG.SIGNUP.ENABLED && CONFIG.SIGNUP.REQUIRES_EMAIL_VERIFICATION) {
return 'Emailer is disabled but you require signup email verification.'
}