From 762f890f41fce5a4fb9cee697f07bdcefc2cd809 Mon Sep 17 00:00:00 2001 From: Kuba Orlik Date: Mon, 1 Aug 2022 20:01:10 +0200 Subject: [PATCH] Fix crash when changing admin email --- src/back/collections/users.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/back/collections/users.ts b/src/back/collections/users.ts index b0e7f92..0a003bd 100644 --- a/src/back/collections/users.ts +++ b/src/back/collections/users.ts @@ -18,9 +18,10 @@ export default class Users extends Collections.users { assert(app instanceof TheApp); await super.init(app, name); app.on("started", async () => { + const username = "admin"; const users = await app.collections.users .suList() - .filter({ email: app.manifest.admin_email }) + .filter({ username }) .fetch(); if (users.empty) { app.Logger.warn( @@ -28,7 +29,7 @@ export default class Users extends Collections.users { `Creating an admin account for ${app.manifest.admin_email}` ); await app.collections.users.suCreate({ - username: "admin", + username, password: "adminadmin", email: "admin@example.com", roles: [],