upd: add recommended checks

This commit is contained in:
Marie 2024-10-17 21:56:43 +02:00
parent 5152192e09
commit fea7889e0c
No known key found for this signature in database
GPG key ID: 7ADF6C9CD9A28555

View file

@ -45,6 +45,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw new Error('user not found or already deleted');
}
if (user.approved) {
throw new Error('user is already approved');
}
if (user.host) {
throw new Error('user is not local');
}
const profile = await this.userProfilesRepository.findOneBy({ userId: ps.userId });
if (profile?.email) {