From c8e19414d1b096aafa1b7e6197f1b09bcc14022f Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Wed, 5 Apr 2023 14:05:04 +0100 Subject: [PATCH] Fix registration functions Signed-off-by: Fred Boniface --- src/services/register.services.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/services/register.services.js b/src/services/register.services.js index 456b218..d135c32 100644 --- a/src/services/register.services.js +++ b/src/services/register.services.js @@ -1,16 +1,16 @@ -const log = require('../utils/log.utils') // Currently no logging on this page -const auth = require('../utils/auth.utils') -const db = require('./dbAccess.services') -const mail = require('./mail.services') -const clean = require('../utils/sanitizer.utils') -const domList= require('../configs/domains.configs') +const log = require('../utils/log.utils') // Currently no logging on this page +const auth = require('../utils/auth.utils') +const db = require('./dbAccess.services') +const mail = require('./mail.services') +const clean = require('../utils/sanitizer.utils') +const domList = require('../configs/domains.configs') async function createRegKey(eml){ - const domain = clean.splitDomain(eml) + const domain = await clean.splitDomain(eml) log.out(`registerServices: New registration request from domain: ${domain}`, "info") - if (domain in domList.valid) { // Don't know if this is correct + if (domList.valid.includes(domain)) { // Needs testing const uuid = auth.generateKey(); - db.addRegReq(await uuid, await domain) + db.addRegReq(await uuid, domain) const message = auth.generateConfirmationEmail(eml, uuid) if (await message == false) { // This error should be handled in the upstream function const err = new Error("Message generation error");