upd: remove idSession since Stripe tends to return NULL

This commit is contained in:
Marie 2024-08-23 20:00:26 +02:00
parent 0627f84e30
commit dbded3b68d
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
4 changed files with 1 additions and 12 deletions

View file

@ -9,12 +9,10 @@ export class idCheck1724044488000 {
async up(queryRunner) { async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "user" ADD "idCheckRequired" boolean NOT NULL DEFAULT false`); 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(`ALTER TABLE "user" ADD "idVerified" boolean NOT NULL DEFAULT false`);
await queryRunner.query(`ALTER TABLE "user" ADD "idSession" character varying(1024) NULL`);
} }
async down(queryRunner) { async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "idCheckRequired"`); await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "idCheckRequired"`);
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "idVerified"`); await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "idVerified"`);
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "idSession"`);
} }
} }

View file

@ -315,11 +315,6 @@ export class MiUser {
}) })
public idVerified: boolean; public idVerified: boolean;
@Column('varchar', {
length: 1024, nullable: true,
})
public idSession: string | null;
constructor(data: Partial<MiUser>) { constructor(data: Partial<MiUser>) {
if (data == null) return; if (data == null) return;

View file

@ -94,7 +94,7 @@ export class StripeHookServerService {
}); });
} }
this.logger.succ(`${user.username} has succesfully approved their ID via Session ${user.idSession}`); this.logger.succ(`${user.username} has succesfully approved their ID via Session ${verificationSession.client_reference_id}`);
await this.usersRepository.update(user.id, { idCheckRequired: false, idVerified: true }); await this.usersRepository.update(user.id, { idCheckRequired: false, idVerified: true });

View file

@ -74,10 +74,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
}, },
}); });
await this.usersRepository.update(me.id, {
idSession: verificationSession.client_reference_id,
});
return { 'url': verificationSession.url }; return { 'url': verificationSession.url };
}); });
} }