parent
95fcac3e55
commit
abff66eada
|
@ -107,6 +107,7 @@ export async function signup(opts: {
|
|||
isAdmin:
|
||||
(await Users.countBy({
|
||||
host: IsNull(),
|
||||
isAdmin: true,
|
||||
})) === 0,
|
||||
}),
|
||||
);
|
||||
|
|
|
@ -35,6 +35,7 @@ export default define(meta, paramDef, async (ps, _me) => {
|
|||
const noUsers =
|
||||
(await Users.countBy({
|
||||
host: IsNull(),
|
||||
isAdmin: true,
|
||||
})) === 0;
|
||||
if (!(noUsers || me?.isAdmin)) throw new Error("access denied");
|
||||
|
||||
|
|
|
@ -489,6 +489,7 @@ export default define(meta, paramDef, async (ps, me) => {
|
|||
requireSetup:
|
||||
(await Users.countBy({
|
||||
host: IsNull(),
|
||||
isAdmin: true,
|
||||
})) === 0,
|
||||
}
|
||||
: {}),
|
||||
|
|
Loading…
Reference in New Issue