fix: only show emailChanged alert for self

This commit is contained in:
Barış Soner Uşaklı
2023-10-03 20:16:01 -04:00
parent 90692d95b6
commit 56794cf869

View File

@@ -97,7 +97,9 @@ Interstitials.email = async (data) => {
}).catch((err) => {
winston.error(`[user.interstitials.email] Validation email failed to send\n[emailer.send] ${err.stack}`);
});
data.req.session.emailChanged = 1;
if (isSelf) {
data.req.session.emailChanged = 1;
}
} else {
// User attempting to edit another user's email -- not allowed
throw new Error('[[error:no-privileges]]');