Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit 35c8d15

Browse files
some fixes and cleanup
1 parent 567c768 commit 35c8d15

3 files changed

Lines changed: 3 additions & 12 deletions

File tree

config/default.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"host": "localhost",
33
"port": 3030,
4-
"frontport": 3000,
54
"baseURL": "http://localhost:3030",
65
"public": "../public/",
76
"paginate": {

config/production.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"host": "HOST",
33
"port": "PORT",
4-
"baseUrl": "BASE_URL",
4+
"baseURL": "BASE_URL",
55
"mongodb": "MONGO_DB",
66
"smtpConfig": {
77
"host": "SMTP_HOST",

server/services/auth-management/notifier.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,8 @@ const EmailTemplate = require('email-templates').EmailTemplate;
77
module.exports = function(app) {
88
const returnEmail = app.get('defaultEmail');
99

10-
function getBaseUrl() {
11-
const port = (!app.get('frontport') || isProd) ? '' : ':' + app.get('frontport');
12-
const host = app.get('host')|| 'localhost';
13-
let protocol = app.get('protocol') || 'http';
14-
protocol += '://';
15-
return `${protocol}${host}${port}`;
16-
}
17-
1810
function getLink(type, hash) {
19-
const baseUrl = getBaseUrl();
11+
const baseUrl = app.get('baseURL');
2012
return `${baseUrl}/auth/${type}/${hash}`;
2113
}
2214

@@ -31,7 +23,7 @@ module.exports = function(app) {
3123
const templatePath = path.join(__dirname, '../../../email-templates/account', templatename);
3224

3325
const hashLink = getLink(linktype, user.verifyToken);
34-
const baseUrl = getBaseUrl();
26+
const baseUrl = app.get('baseURL');
3527

3628
const template = new EmailTemplate(templatePath, {juiceOptions: {
3729
preserveMediaQueries: true,

0 commit comments

Comments
 (0)