diff --git a/models/Pagans.js b/models/Pagans.js index 68bfd95..6a10eac 100644 --- a/models/Pagans.js +++ b/models/Pagans.js @@ -125,10 +125,10 @@ Pagans.sendmailkey = (data) => { person.avecpassphrase=(person.passphrase!="") console.log("person:", person); - - let tplfile=`../../../${data.tribe}/template/createidentity_${data.lg}.js`; + console.log(path.resolve(`../../${data.tribe}/template/createidentity_${data.lg}.js`)) + let tplfile=`../../${data.tribe}/template/createidentity_${data.lg}.js`; if (!fs.existsSync(tplfile)){ - tplfile=`../../adminapi/template/createidentity_${data.lg}.js`; + tplfile=`../template/createidentity_${data.lg}.js`; if (!fs.existsSync(tplfile)){ return { status:406, @@ -138,7 +138,7 @@ Pagans.sendmailkey = (data) => { } } } - const tplemail = require(tplfile) + const tplemail = require(path.resolve(tplfile)) const maildata = { to: person.email, diff --git a/routes/pagans.js b/routes/pagans.js index 4104d9b..01a49e1 100755 --- a/routes/pagans.js +++ b/routes/pagans.js @@ -137,7 +137,8 @@ router.post("/", checkHeaders, isAuthenticated, async (req, res) => { return } const objpagan = { alias: req.body.alias, publickey: req.body.publickey }; - const newpagan = Odmdb.cud(`../../objects/pagans`, "C", objpagan, role); + console.log(path.resolve(`../objects/pagans`)) + const newpagan = Odmdb.cud(`../objects/pagans`, "C", objpagan, role); const createprocess={status:200, ref:"Pagans", msg:"successfulcreate",data:{alias:req.body.alias}}; if (newpagan.status == 200) { if (req.body.email) {