mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
feat: show instructional modal after email change request
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
|
||||
define('forum/account/profile', [
|
||||
'forum/account/header',
|
||||
'components',
|
||||
], function (header) {
|
||||
'bootbox',
|
||||
], function (header, bootbox) {
|
||||
var Account = {};
|
||||
|
||||
Account.init = function () {
|
||||
@@ -14,6 +14,10 @@ define('forum/account/profile', [
|
||||
|
||||
processPage();
|
||||
|
||||
if (parseInt(ajaxify.data.emailChanged, 10) === 1) {
|
||||
bootbox.alert('[[user:emailUpdate.change-instructions]]');
|
||||
}
|
||||
|
||||
socket.removeListener('event:user_status_change', onUserStatusChange);
|
||||
socket.on('event:user_status_change', onUserStatusChange);
|
||||
};
|
||||
|
||||
@@ -50,6 +50,10 @@ profileController.get = async function (req, res, next) {
|
||||
userData.title = userData.username;
|
||||
userData.allowCoverPicture = !userData.isSelf || !!meta.config['reputation:disabled'] || userData.reputation >= meta.config['min:rep:cover-picture'];
|
||||
|
||||
// Show email changed modal on first access after said change
|
||||
userData.emailChanged = req.session.emailChanged;
|
||||
delete req.session.emailChanged;
|
||||
|
||||
if (!userData.profileviews) {
|
||||
userData.profileviews = 1;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ Interstitials.email = async (data) => {
|
||||
email: formData.email,
|
||||
force: true,
|
||||
});
|
||||
data.req.session.emailChanged = 1;
|
||||
} else {
|
||||
// User attempting to edit another user's email -- not allowed
|
||||
throw new Error('[[error:no-privileges]]');
|
||||
|
||||
Reference in New Issue
Block a user