Add admin role to the admin user on start
This commit is contained in:
parent
897654ebf1
commit
8a249b96ac
@ -30,12 +30,13 @@ export default class Users extends Collections.users {
|
|||||||
"ADMIN",
|
"ADMIN",
|
||||||
`Creating an admin account for ${app.manifest.admin_email}`
|
`Creating an admin account for ${app.manifest.admin_email}`
|
||||||
);
|
);
|
||||||
await app.collections.users.suCreate({
|
const { id } = await app.collections.users.suCreate({
|
||||||
username,
|
username,
|
||||||
password: ADMIN_CREDENTIALS.password,
|
password: ADMIN_CREDENTIALS.password,
|
||||||
email: ADMIN_CREDENTIALS.email,
|
email: ADMIN_CREDENTIALS.email,
|
||||||
roles: [],
|
roles: [],
|
||||||
});
|
});
|
||||||
|
await app.collections["user-roles"].suCreate({ user: id, role: "admin" });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user