From 2eaff3388f7dedfeca1902a2ab7ab8d484aa9790 Mon Sep 17 00:00:00 2001 From: Marie Date: Sun, 8 Sep 2024 12:55:12 +0200 Subject: [PATCH] upd: make sure system users get the values properly set --- packages/backend/migration/1724044488000-idCheck.js | 2 ++ packages/backend/src/core/CreateSystemUserService.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/packages/backend/migration/1724044488000-idCheck.js b/packages/backend/migration/1724044488000-idCheck.js index 31a4db7717..29c02c4318 100644 --- a/packages/backend/migration/1724044488000-idCheck.js +++ b/packages/backend/migration/1724044488000-idCheck.js @@ -9,6 +9,8 @@ export class idCheck1724044488000 { async up(queryRunner) { await queryRunner.query(`ALTER TABLE "user" ADD "idCheckRequired" boolean NOT NULL DEFAULT false`); await queryRunner.query(`ALTER TABLE "user" ADD "idVerified" boolean NOT NULL DEFAULT false`); + await queryRunner.query(`UPDATE "user" SET "idVerified" = true WHERE "usernameLower" = 'instance.actor' AND "idVerified" = false`); + await queryRunner.query(`UPDATE "user" SET "idVerified" = true WHERE "usernameLower" = 'relay.actor' AND "idVerified" = false`); } async down(queryRunner) { diff --git a/packages/backend/src/core/CreateSystemUserService.ts b/packages/backend/src/core/CreateSystemUserService.ts index 14d814b0e6..f0da19bcbd 100644 --- a/packages/backend/src/core/CreateSystemUserService.ts +++ b/packages/backend/src/core/CreateSystemUserService.ts @@ -63,6 +63,8 @@ export class CreateSystemUserService { isExplorable: false, approved: true, isBot: true, + idCheckRequired: false, + idVerified: true, }).then(x => transactionalEntityManager.findOneByOrFail(MiUser, x.identifiers[0])); await transactionalEntityManager.insert(MiUserKeypair, {