Skip to content

Commit

Permalink
fix(mail): added notification_email to morgan (#238)
Browse files Browse the repository at this point in the history
* fix(mail): password reset should go to personal email

Because the GSuite password is the same as the MyAEGEE password, creating a weird loop

* fix(mail): added notification_email to morgan
  • Loading branch information
WikiRik committed Feb 23, 2021
1 parent 9ac9df2 commit fd66588
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/morgan.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const log = require('./logger');

module.exports = morgan((tokens, req, res) => {
const user = req.user
? _.pick(req.user, ['id', 'username', 'first_name', 'last_name', 'email'])
? _.pick(req.user, ['id', 'username', 'first_name', 'last_name', 'email', 'notification_email'])
: undefined;

const body = _.isEmpty(req.body)
Expand Down
2 changes: 1 addition & 1 deletion middlewares/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ module.exports.passwordReset = async (req, res) => {
const currentReset = await PasswordReset.createForUser(user.id, t);

await mailer.sendMail({
to: user.notification_email,
to: user.email,
subject: constants.MAIL_SUBJECTS.PASSWORD_RESET,
template: 'password_reset.html',
parameters: {
Expand Down

0 comments on commit fd66588

Please sign in to comment.