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

Commit

Permalink
Merge pull request #924 from lirantal/bugfix/923-ssl-support-for-pass…
Browse files Browse the repository at this point in the history
…word-reset

Fixed #923 - password reset links SSL support
  • Loading branch information
lirantal committed Sep 23, 2015
2 parents 658ac8d + b824ebc commit cdd6a79
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 cdd6a79

Please sign in to comment.