mirror of
https://github.com/wekan/wekan.git
synced 2025-04-23 13:37:09 -04:00
Merge pull request #5037 from mfilser/first_registration_must_be_an_admin_user
first registration after installation must be an admin account
This commit is contained in:
commit
c4fdc5987b
1 changed files with 2 additions and 4 deletions
|
@ -1671,10 +1671,8 @@ if (Meteor.isServer) {
|
|||
},
|
||||
});
|
||||
Accounts.onCreateUser((options, user) => {
|
||||
const userCount = ReactiveCache.getUsers().length;
|
||||
if (userCount === 0) {
|
||||
user.isAdmin = true;
|
||||
}
|
||||
const userCount = ReactiveCache.getUsers({}, {}, true).count();
|
||||
user.isAdmin = userCount === 0;
|
||||
|
||||
if (user.services.oidc) {
|
||||
let email = user.services.oidc.email;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue