From 01663da7ecf2cbc84c0936fff78b8b6c620176cb Mon Sep 17 00:00:00 2001 From: Chareice Date: Sun, 19 Feb 2023 16:20:14 +0800 Subject: [PATCH] fix: install user error --- packages/plugins/users/src/server.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/plugins/users/src/server.ts b/packages/plugins/users/src/server.ts index 0050e15be..9335345e3 100644 --- a/packages/plugins/users/src/server.ts +++ b/packages/plugins/users/src/server.ts @@ -155,6 +155,10 @@ export default class UsersPlugin extends Plugin { async install(options) { const { rootNickname, rootPassword, rootEmail } = this.getInstallingData(options); const User = this.db.getCollection('users'); + if (await User.repository.findOne({ filter: { email: rootEmail } })) { + return; + } + const user = await User.repository.create({ values: { email: rootEmail,