This repository was archived by the owner on Jun 27, 2019. It is now read-only.
File tree Expand file tree Collapse file tree
server/services/auth-management Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "host" : " localhost" ,
33 "port" : 3030 ,
4- "frontport" : 3000 ,
54 "baseURL" : " http://localhost:3030" ,
65 "public" : " ../public/" ,
76 "paginate" : {
Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change @@ -7,16 +7,8 @@ const EmailTemplate = require('email-templates').EmailTemplate;
77module . 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 ,
You can’t perform that action at this time.
0 commit comments