From 052bbfd5dca5ef968b831800dfe0378cf03bcdcd Mon Sep 17 00:00:00 2001 From: Avris Date: Mon, 12 Apr 2021 21:19:25 +0200 Subject: [PATCH] #198 check email dns - dynamic require --- server/routes/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/routes/user.js b/server/routes/user.js index f4fab3ca..efa9c38a 100644 --- a/server/routes/user.js +++ b/server/routes/user.js @@ -8,7 +8,6 @@ import { loadSuml } from '../loader'; import avatar from '../avatar'; import { config as socialLoginConfig, handlers as socialLoginHandlers } from '../social'; import cookieSettings from "../../src/cookieSettings"; -import { Resolver } from "dns/promises"; const config = loadSuml('config'); const translations = loadSuml('translations'); @@ -104,6 +103,7 @@ const validateEmail = async (email) => { if (!re.test(email)) { return false; } + const { Resolver } = require('dns').promises; const dns = new Resolver(); try { const addresses = await dns.resolveMx(email.split('@')[1]);