upd: make sure system users get the values properly set

This commit is contained in:
Marie 2024-09-08 12:55:12 +02:00
parent ed95e8168c
commit 2eaff3388f
No known key found for this signature in database
GPG Key ID: 56569BBE47D2C828
2 changed files with 4 additions and 0 deletions

View File

@ -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) {

View File

@ -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, {