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
1 changed files with 8 additions and 0 deletions

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'); 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 }); const profile = await this.userProfilesRepository.findOneBy({ userId: ps.userId });
if (profile?.email) { if (profile?.email) {