From e4316d3ba47615fee879ad3d0179e0e764e2fdca Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Wed, 25 Sep 2024 10:35:55 +0900 Subject: [PATCH] =?UTF-8?q?=E7=84=A1=E3=81=84=E3=81=AE=E3=81=AB=E5=85=A5?= =?UTF-8?q?=E5=8A=9B=E3=81=95=E3=82=8C=E3=81=9F=E5=A0=B4=E5=90=88=E3=82=82?= =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend/src/server/api/endpoints/admin/accounts/create.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/backend/src/server/api/endpoints/admin/accounts/create.ts b/packages/backend/src/server/api/endpoints/admin/accounts/create.ts index a9cc399225..235cca4f38 100644 --- a/packages/backend/src/server/api/endpoints/admin/accounts/create.ts +++ b/packages/backend/src/server/api/endpoints/admin/accounts/create.ts @@ -72,8 +72,12 @@ export default class extends Endpoint { // eslint- super(meta, paramDef, async (ps, _me, token) => { if (ps.initialPassword != null && this.config.initialPassword != null) { if (ps.initialPassword !== this.config.initialPassword) { + // 初期パスワードが違う場合 throw new ApiError(meta.errors.wrongInitialPassword); } + } else if (this.config.initialPassword == null && (ps.initialPassword != null && ps.initialPassword.trim() !== '')) { + // 初期パスワードが設定されていないのに初期パスワードが入力された場合 + throw new ApiError(meta.errors.wrongInitialPassword); } const me = _me ? await this.usersRepository.findOneByOrFail({ id: _me.id }) : null;