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)