mailer is an admin method, so added auth check to request

pull/20/head
Ro 4 years ago
parent 5227b1faa1
commit 09efd3c348

@ -1,11 +1,15 @@
import Settings, { SETTINGS_FILE } from '../../data/Settings';
import Auth from '../../data/Auth';
var express = require('express');
var router = express.Router();
var nodemailer = require('nodemailer');
var mg = require('nodemailer-mailgun-transport');
const pug = require('pug');
const settings = new Settings();
const auth = new Auth();
router.post('/', function (req, res) {
auth.authCheck(req)
.then(() => {
settings
.load(SETTINGS_FILE)
.then(settings => {
@ -71,5 +75,9 @@ router.post('/', function (req, res) {
.catch(() => {
//console.error(err);
});
})
.catch(err => {
res.json(err);
});
});
module.exports = router;

Loading…
Cancel
Save