From b14f1c9303df621ac2ca77e810dcc793c4899317 Mon Sep 17 00:00:00 2001
From: Wolfgang Knopki <wolfgang.knopki@hft-stuttgart.de>
Date: Mon, 9 Dec 2019 14:29:45 +0100
Subject: [PATCH] email text adapted, hostname created from config file

---
 config/config.js | 1 +
 routes/routes.js | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/config/config.js b/config/config.js
index 497c356e..763c0be7 100644
--- a/config/config.js
+++ b/config/config.js
@@ -1,6 +1,7 @@
 module.exports = {
   development: {
     app: {
+      hostname: 'm4lab.hft-stuttgart.de',
       name: 'User Account Management',
       hostname: 'm4lab.hft-stuttgart.de/account',
       port: process.env.PORT || 9989
diff --git a/routes/routes.js b/routes/routes.js
index fd8a5453..c4755966 100644
--- a/routes/routes.js
+++ b/routes/routes.js
@@ -391,7 +391,7 @@ module.exports = function (app, config, passport) {
             emailSubject = "M4_LAB Password Reset";
             emailContent = "Hi User,\n\n"+
               "we've received a request to reset your password. If you didn't make the request, just ignore this email.\n\n"+
-              "Otherwise, you can reset your password using this link: http://" + req.headers.host + "/reset/" + token + "\n" +
+              "Otherwise, you can reset your password using this link: https://" + config.app.hostname + "/reset/" + token + "\n" +
               "This password reset is only valid for 1 hour.\n\n"+
               "Thanks,\nM4_LAB Team"
             
-- 
GitLab