admin/accounts/createで一般ユーザーがアカウントを作成し放題なのを修正 (#6205)

This commit is contained in:
MeiMei 2020-03-30 09:27:39 +09:00 committed by GitHub
parent b9ea774c2a
commit a6f4923d18

View file

@ -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);