|
@@ -90,7 +90,8 @@ module.exports = function(crowi, app) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
User.findOne({email: email}, (err, existingUserData) => {
|
|
User.findOne({email: email}, (err, existingUserData) => {
|
|
|
- if (existingUserData) {
|
|
|
|
|
|
|
+ // If another user uses the same email, an error will occur.
|
|
|
|
|
+ if (existingUserData && !existingUserData._id.equals(userData._id)) {
|
|
|
debug('Email address was duplicated');
|
|
debug('Email address was duplicated');
|
|
|
req.form.errors.push('It can not be changed to that mail address');
|
|
req.form.errors.push('It can not be changed to that mail address');
|
|
|
return res.render('me/index', {});
|
|
return res.render('me/index', {});
|