diff --git a/src/server/api/endpoints/admin/accounts/create.ts b/src/server/api/endpoints/admin/accounts/create.ts index ac80b579b7..16fe3e36da 100644 --- a/src/server/api/endpoints/admin/accounts/create.ts +++ b/src/server/api/endpoints/admin/accounts/create.ts @@ -18,7 +18,7 @@ export const meta = { export default define(meta, async (ps, me) => { const noUsers = (await Users.count({})) === 0; - if (!noUsers && me == null) throw new Error('access denied'); + if (!noUsers && !me?.isAdmin) throw new Error('access denied'); const { account, secret } = await signup(ps.username, ps.password);