diff --git a/packages/backend/src/server/api/endpoints/admin/decline-user.ts b/packages/backend/src/server/api/endpoints/admin/decline-user.ts index 2f127b0cd9..0a75dd977d 100644 --- a/packages/backend/src/server/api/endpoints/admin/decline-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/decline-user.ts @@ -45,6 +45,14 @@ export default class extends Endpoint { // 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) {