Skip to content

Commit

Permalink
fixup! feat: Two Factor API
Browse files Browse the repository at this point in the history
Signed-off-by: SebastianKrupinski <[email protected]>
  • Loading branch information
SebastianKrupinski committed Jan 15, 2025
1 parent 001e527 commit 900130c
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions core/Controller/TwoFactorApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,11 @@ public function __construct(
*
* 200: user/provider states
*/
#[ApiRoute(verb: 'POST', url: '/state', root: '/twofactor')]
public function state(array $users = []): DataResponse {
$states = [];
foreach ($users as $userId) {
$userObject = $this->userManager->get($userId);
if ($userObject !== null) {
$states[$userId] = $this->tfRegistry->getProviderStates($userObject);
}
#[ApiRoute(verb: 'GET', url: '/state', root: '/twofactor')]
public function state(string $user): DataResponse {
$userObject = $this->userManager->get($user);
if ($userObject !== null) {
$states = $this->tfRegistry->getProviderStates($userObject);
}
return new DataResponse($states);
}
Expand Down

0 comments on commit 900130c

Please sign in to comment.