Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
fixed bug #923 - making password reset links work for both http and h…
Browse files Browse the repository at this point in the history
…ttps configuration
  • Loading branch information
lirantal committed Sep 19, 2015
1 parent be3622b commit b824ebc
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,15 @@ exports.forgot = function (req, res, next) {
}
},
function (token, user, done) {

var httpTransport = 'http://';
if (config.secure && config.secure.ssl === true) {
httpTransport = 'https://';
}
res.render(path.resolve('modules/users/server/templates/reset-password-email'), {
name: user.displayName,
appName: config.app.title,
url: 'http://' + req.headers.host + '/api/auth/reset/' + token
url: httpTransport + req.headers.host + '/api/auth/reset/' + token
}, function (err, emailHTML) {
done(err, emailHTML, user);
});
Expand Down

0 comments on commit b824ebc

Please sign in to comment.