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