Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

626 B
Raw Blame
<?php

namespace HiEvents\Http\Actions\Users\TwoFactor;

use HiEvents\Http\Actions\BaseAction;
use HiEvents\Http\Attributes\AllowedForReadOnlyUsers;
use HiEvents\Services\Application\Handlers\User\TwoFactor\RevokeTrustedDevicesHandler;
use Illuminate\Http\Response;

#[AllowedForReadOnlyUsers]
class RevokeTrustedDevicesAction extends BaseAction
{
    public function __construct(
        private readonly RevokeTrustedDevicesHandler $handler,
    ) {}

    public function __invoke(): Response
    {
        $this->handler->revokeAll($this->getAuthenticatedUser()->getId());

        return $this->deletedResponse();
    }
}