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

Commit b824ebc

Browse files
committed
fixed bug #923 - making password reset links work for both http and https configuration
1 parent be3622b commit b824ebc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

modules/users/server/controllers/users/users.password.server.controller.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,15 @@ exports.forgot = function (req, res, next) {
5656
}
5757
},
5858
function (token, user, done) {
59+
60+
var httpTransport = 'http://';
61+
if (config.secure && config.secure.ssl === true) {
62+
httpTransport = 'https://';
63+
}
5964
res.render(path.resolve('modules/users/server/templates/reset-password-email'), {
6065
name: user.displayName,
6166
appName: config.app.title,
62-
url: 'http://' + req.headers.host + '/api/auth/reset/' + token
67+
url: httpTransport + req.headers.host + '/api/auth/reset/' + token
6368
}, function (err, emailHTML) {
6469
done(err, emailHTML, user);
6570
});

0 commit comments

Comments
 (0)