Log activity when modifying account details

This commit is contained in:
DaneEveritt 2022-05-29 18:48:35 -04:00
parent 0b2c0db170
commit 287fd60891
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
15 changed files with 85 additions and 57 deletions

View file

@ -6,6 +6,7 @@ use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Http\JsonResponse;
use Pterodactyl\Facades\Activity;
use Illuminate\Contracts\Validation\Factory;
use Illuminate\Validation\ValidationException;
use Pterodactyl\Services\Users\TwoFactorSetupService;
@ -89,6 +90,8 @@ class TwoFactorController extends ClientApiController
$tokens = $this->toggleTwoFactorService->handle($request->user(), $request->input('code'), true);
Activity::event('user:two-factor.create')->log();
return new JsonResponse([
'object' => 'recovery_tokens',
'attributes' => [
@ -117,6 +120,8 @@ class TwoFactorController extends ClientApiController
'use_totp' => false,
]);
Activity::event('user:two-factor.delete')->log();
return new JsonResponse([], Response::HTTP_NO_CONTENT);
}
}