From cd8a71c56d75d5f547c56ee7fe45b8100e7e4e89 Mon Sep 17 00:00:00 2001 From: Sem Bauke <46919888+Sembauke@users.noreply.github.com> Date: Fri, 1 Oct 2021 19:34:54 +0200 Subject: [PATCH] fix: wrong flash message when changing email (#43653) --- api-server/src/server/boot/authentication.js | 6 +++++- client/i18n/locales/english/translations.json | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/api-server/src/server/boot/authentication.js b/api-server/src/server/boot/authentication.js index a662fe4d1d..5e9320b7c3 100644 --- a/api-server/src/server/boot/authentication.js +++ b/api-server/src/server/boot/authentication.js @@ -175,7 +175,11 @@ function createGetPasswordlessAuth(app) { // update user and log them in .map(user => user.loginByRequest(req, res)) .do(() => { - req.flash('success', 'flash.signin-success'); + if (emailChange) { + req.flash('success', 'flash.email-valid'); + } else { + req.flash('success', 'flash.signin-success'); + } return res.redirectWithFlash(`${origin}/learn`); }) .subscribe(() => {}, next) diff --git a/client/i18n/locales/english/translations.json b/client/i18n/locales/english/translations.json index 3aa64e0ae1..d782b61f8c 100644 --- a/client/i18n/locales/english/translations.json +++ b/client/i18n/locales/english/translations.json @@ -427,6 +427,7 @@ "wrong-updating": "Something went wrong updating your account. Please check and try again", "updated-preferences": "We have updated your preferences", "email-invalid": "Email format is invalid", + "email-valid": "Your email has successfully been changed, happy coding!", "bad-challengeId": "currentChallengeId is not a valid challenge ID", "theme-invalid": "Theme is invalid", "theme-set": "Theme already set",