Skip to content

Commit

Permalink
email reset use port in dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Berkeley Martinez authored and Berkeley Martinez committed Aug 18, 2015
1 parent 112972c commit 1d3f733
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions common/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,16 @@ module.exports = function(User) {
});

User.on('resetPasswordRequest', function(info) {
let url;
const host = User.app.get('host');
// TODO(berks) get protocol as well
const url = `http://${host}/reset-password?access_token=` +
info.accessToken.id;
const { id: token } = info.accessToken;
if (process.env.NODE_ENV === 'development') {
const port = User.app.get('port');
url = `http://${host}:${port}/reset-password?access_token=${token}`;
} else {
url =
`http://${host}/reset-password?access_token=${token}`;
}

// the email of the requested user
debug(info.email);
Expand Down

0 comments on commit 1d3f733

Please sign in to comment.