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

This commit is contained in:
MeiMei 2020-03-30 09:27:39 +09:00 committed by GitHub
parent a448172952
commit 4c6d0386b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

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