pis #12
@ -3,14 +3,14 @@ const auth = require('../utils/auth.utils')
|
|||||||
const db = require('./dbAccess.services')
|
const db = require('./dbAccess.services')
|
||||||
const mail = require('./mail.services')
|
const mail = require('./mail.services')
|
||||||
const clean = require('../utils/sanitizer.utils')
|
const clean = require('../utils/sanitizer.utils')
|
||||||
const domList= require('../configs/domains.configs')
|
const domList = require('../configs/domains.configs')
|
||||||
|
|
||||||
async function createRegKey(eml){
|
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")
|
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();
|
const uuid = auth.generateKey();
|
||||||
db.addRegReq(await uuid, await domain)
|
db.addRegReq(await uuid, domain)
|
||||||
const message = auth.generateConfirmationEmail(eml, uuid)
|
const message = auth.generateConfirmationEmail(eml, uuid)
|
||||||
if (await message == false) { // This error should be handled in the upstream function
|
if (await message == false) { // This error should be handled in the upstream function
|
||||||
const err = new Error("Message generation error");
|
const err = new Error("Message generation error");
|
||||||
|
Loading…
Reference in New Issue
Block a user