diff options
author | guillaume <guillaume.cassou@supinfo.com> | 2018-07-18 10:07:03 +0200 |
---|---|---|
committer | guillaume <guillaume.cassou@supinfo.com> | 2018-07-18 10:07:03 +0200 |
commit | e2ae5d6b8e5d2b8b23ecfb48c54a7a748eb425a6 (patch) | |
tree | 14dbe631f08190d49fae077a8fa14d48c1ebd24e /models | |
parent | bf5596b20182628a6a9285c86a239b1f61b96fdf (diff) | |
download | wekan-e2ae5d6b8e5d2b8b23ecfb48c54a7a748eb425a6.tar.gz wekan-e2ae5d6b8e5d2b8b23ecfb48c54a7a748eb425a6.tar.bz2 wekan-e2ae5d6b8e5d2b8b23ecfb48c54a7a748eb425a6.zip |
remove invitation code
Diffstat (limited to 'models')
-rw-r--r-- | models/users.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/models/users.js b/models/users.js index 31590cea..9d859664 100644 --- a/models/users.js +++ b/models/users.js @@ -501,12 +501,13 @@ if (Meteor.isServer) { } else { user.profile = {icode: options.profile.invitationcode}; user.profile.boardView = 'board-view-lists'; - } - - // Deletes the invitation. - InvitationCodes.remove(invitationCode._id); - return user; + // Deletes the invitation code after the user was created successfully. + setTimeout(Meteor.bindEnvironment(() => { + InvitationCodes.remove({'_id': invitationCode._id}); + }), 200); + return user; + } }); } |