Skip to content

Commit

Permalink
feat(ApiController): add endpoint to de-provision user
Browse files Browse the repository at this point in the history
Signed-off-by: Edward Ly <contact@edward.ly>
  • Loading branch information
edward-ly committed Oct 10, 2024
1 parent 94a818b commit 45936f2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,18 @@ public function createUser(int $providerId, string $userId, ?string $displayName

return new DataResponse(['user_id' => $user->getUID()]);
}

/**
* @param string $userId
* @return DataResponse
*/
#[FrontpageRoute(verb: 'DELETE', url: '/user/{userId}')]

Check failure on line 105 in lib/Controller/ApiController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

UndefinedAttributeClass

lib/Controller/ApiController.php:105:4: UndefinedAttributeClass: Attribute class OCA\UserOIDC\Controller\FrontpageRoute does not exist (see https://psalm.dev/241)
public function deleteUser(string $userId): DataResponse {
$user = $this->userManager->get($userId);
if (!is_null($user)) {
$user->delete();
}

return new DataResponse(['user_id' => $userId]);
}
}

0 comments on commit 45936f2

Please sign in to comment.