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