Skip to content

Commit

Permalink
do not allow deleting non managed users
Browse files Browse the repository at this point in the history
  • Loading branch information
supalarry committed Mar 25, 2024
1 parent c364679 commit 1e9a803
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -152,7 +152,11 @@ export class OAuthClientUsersController {
const existingUser = await this.userRepository.findById(userId);

if (!existingUser) {
throw new NotFoundException(`User with ${userId} does not exist`);
throw new NotFoundException(`User with ID=${userId} does not exist`);
}

if (!existingUser.isPlatformManaged) {
throw new NotFoundException(`Can't delete non managed user with ID=${userId}`);
}

const user = await this.userRepository.delete(userId);
Expand Down

0 comments on commit 1e9a803

Please sign in to comment.