From 4c6d0386b903797b80ffec4ba9e94ed044c9cf86 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Mon, 30 Mar 2020 09:27:39 +0900 Subject: [PATCH] =?UTF-8?q?admin/accounts/create=E3=81=A7=E4=B8=80?= =?UTF-8?q?=E8=88=AC=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E3=81=8C=E3=82=A2?= =?UTF-8?q?=E3=82=AB=E3=82=A6=E3=83=B3=E3=83=88=E3=82=92=E4=BD=9C=E6=88=90?= =?UTF-8?q?=E3=81=97=E6=94=BE=E9=A1=8C=E3=81=AA=E3=81=AE=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20(#6205)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/api/endpoints/admin/accounts/create.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);