Added the log item

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-03-20 23:43:58 +00:00
parent 1ffbdee156
commit 2067b1138a

View file

@ -663,6 +663,16 @@ class UsersController extends Controller
$user->two_factor_enrolled = 0;
$user->save();
// Log the reset
$logaction = new Actionlog();
$logaction->target_type = User::class;
$logaction->target_id = $user->id;
$logaction->item_type = User::class;
$logaction->item_id = $user->id;
$logaction->created_at = date('Y-m-d H:i:s');
$logaction->user_id = Auth::user()->id;
$logaction->logaction('2FA reset');
return response()->json(['message' => trans('admin/settings/general.two_factor_reset_success')], 200);
} catch (\Exception $e) {
return response()->json(['message' => trans('admin/settings/general.two_factor_reset_error')], 500);