X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Fserver.ts;h=6eff8e9ee9eea056a2192938d50fbf5c0f5f0ee3;hb=ad91e7006e41f8ee5b8dcefee30f99e8ca44133a;hp=d82e19230bd12dd036713810f4cb45723c1b0af7;hpb=a4101923e699e49ceb9ff36e971c75417fafc9f0;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/validators/server.ts b/server/middlewares/validators/server.ts index d82e19230..6eff8e9ee 100644 --- a/server/middlewares/validators/server.ts +++ b/server/middlewares/validators/server.ts @@ -7,7 +7,7 @@ import { body } from 'express-validator/check' import { isUserDisplayNameValid } from '../../helpers/custom-validators/users' import { Emailer } from '../../lib/emailer' import { Redis } from '../../lib/redis' -import { CONFIG } from '../../initializers/constants' +import { CONFIG } from '../../initializers/config' const serverGetValidator = [ body('host').custom(isHostValid).withMessage('Should have a valid host'), @@ -50,14 +50,14 @@ const contactAdministratorValidator = [ .end() } - if (Emailer.Instance.isEnabled() === false) { + if (Emailer.isEnabled() === false) { return res .status(409) .send({ error: 'Emailer is not enabled on this instance.' }) .end() } - if (await Redis.Instance.isContactFormIpExists(req.ip)) { + if (await Redis.Instance.doesContactFormIpExist(req.ip)) { logger.info('Refusing a contact form by %s: already sent one recently.', req.ip) return res