mirror of
https://github.com/wekan/wekan.git
synced 2026-01-04 16:48:49 +01:00
Add change email address
Set allow email change in admin panel
This commit is contained in:
parent
57219df16a
commit
6a10257fd7
9 changed files with 153 additions and 4 deletions
|
|
@ -334,6 +334,28 @@ Meteor.methods({
|
|||
check(limit, Number);
|
||||
Meteor.user().setShowCardsCountAt(limit);
|
||||
},
|
||||
setEmail(email) {
|
||||
check(email, String);
|
||||
const existingUser = Users.findOne({ 'emails.address': email }, { fields: { _id: 1 } });
|
||||
if (existingUser) {
|
||||
throw new Meteor.Error('email-already-taken');
|
||||
} else {
|
||||
Users.update(this.userId, {
|
||||
$set: {
|
||||
emails: [{
|
||||
address: email,
|
||||
verified: false,
|
||||
}],
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
setUsernameAndEmail(username, email) {
|
||||
check(username, String);
|
||||
check(email, String);
|
||||
Meteor.call('setUsername', username);
|
||||
Meteor.call('setEmail', email);
|
||||
},
|
||||
});
|
||||
|
||||
if (Meteor.isServer) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue