fix: wrong flash message when changing email (#43653)

This commit is contained in:
Sem Bauke
2021-10-01 19:34:54 +02:00
committed by GitHub
parent ea7acba786
commit cd8a71c56d
2 changed files with 6 additions and 1 deletions

View File

@ -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)

View File

@ -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",