From 39651688b5d43f4ca116691d7cb2b04991f54bcf Mon Sep 17 00:00:00 2001 From: Rik Smale Date: Mon, 22 Feb 2021 19:03:23 +0100 Subject: [PATCH 1/2] fix(mail): password reset should go to personal email Because the GSuite password is the same as the MyAEGEE password, creating a weird loop --- middlewares/login.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middlewares/login.js b/middlewares/login.js index e83dfdac..12f994ef 100644 --- a/middlewares/login.js +++ b/middlewares/login.js @@ -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: { From 04578b5272db1108c5dc9521b0258f7febfbdafa Mon Sep 17 00:00:00 2001 From: Rik Smale Date: Mon, 22 Feb 2021 19:03:39 +0100 Subject: [PATCH 2/2] fix(mail): added notification_email to morgan --- lib/morgan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/morgan.js b/lib/morgan.js index bd844800..9b55b6e2 100644 --- a/lib/morgan.js +++ b/lib/morgan.js @@ -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)