fix: install user error
This commit is contained in:
parent
24fb25754f
commit
01663da7ec
@ -155,6 +155,10 @@ export default class UsersPlugin extends Plugin<UserPluginConfig> {
|
|||||||
async install(options) {
|
async install(options) {
|
||||||
const { rootNickname, rootPassword, rootEmail } = this.getInstallingData(options);
|
const { rootNickname, rootPassword, rootEmail } = this.getInstallingData(options);
|
||||||
const User = this.db.getCollection('users');
|
const User = this.db.getCollection('users');
|
||||||
|
if (await User.repository.findOne({ filter: { email: rootEmail } })) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const user = await User.repository.create({
|
const user = await User.repository.create({
|
||||||
values: {
|
values: {
|
||||||
email: rootEmail,
|
email: rootEmail,
|
||||||
|
Loading…
Reference in New Issue
Block a user