mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-02-07 23:19:21 +01:00
feat(config): adds a generic DOMAIN configuration environment (#1469)
Generic DOMAI configuration environment variable, useful for setting links to an app in reset email templates, and other cases. Fixes #871 and #847
This commit is contained in:
@@ -61,11 +61,14 @@ exports.forgot = function (req, res, next) {
|
||||
if (config.secure && config.secure.ssl === true) {
|
||||
httpTransport = 'https://';
|
||||
}
|
||||
var baseUrl = req.app.get('domain') || httpTransport + req.headers.host;
|
||||
console.log(baseUrl);
|
||||
res.render(path.resolve('modules/users/server/templates/reset-password-email'), {
|
||||
name: user.displayName,
|
||||
appName: config.app.title,
|
||||
url: httpTransport + req.headers.host + '/api/auth/reset/' + token
|
||||
url: baseUrl + '/api/auth/reset/' + token
|
||||
}, function (err, emailHTML) {
|
||||
console.log(emailHTML);
|
||||
done(err, emailHTML, user);
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user