Skip to content

Commit

Permalink
fixup! fixup! fixup! feat: Add transfer endpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <[email protected]>
  • Loading branch information
Pytal committed Jun 17, 2024
1 parent 2ddef52 commit d57d5f3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ public function transfer(string $email, string $userId, string $password): DataR
return new DataResponse([], Http::STATUS_CONFLICT);
}

if ($this->userManager->userExists($userId)) {
throw new OCSException($this->l10n->t('User already exists'), 102);
}

$newUser = $this->userManager->createUser(
$userId,
$password,
Expand Down

0 comments on commit d57d5f3

Please sign in to comment.