feat: remove legacy UserToken based auth
This commit is contained in:
@@ -7,8 +7,8 @@ use ApiPlatform\State\ProcessorInterface;
|
||||
use App\ApiResource\Project\UpdateApiResource;
|
||||
use App\Entity\Project\Update;
|
||||
use App\Mapping\AutoMapper;
|
||||
use App\Service\Auth\AuthService;
|
||||
use App\State\EntityStateProcessor;
|
||||
use Symfony\Bundle\SecurityBundle\Security;
|
||||
use Symfony\Component\Security\Core\Exception\AuthenticationException;
|
||||
|
||||
class UpdateStateProcessor implements ProcessorInterface
|
||||
@@ -16,7 +16,7 @@ class UpdateStateProcessor implements ProcessorInterface
|
||||
public function __construct(
|
||||
private EntityStateProcessor $entityStateProcessor,
|
||||
private AutoMapper $autoMapper,
|
||||
private AuthService $authService,
|
||||
private Security $security,
|
||||
) {}
|
||||
|
||||
/**
|
||||
@@ -29,7 +29,8 @@ class UpdateStateProcessor implements ProcessorInterface
|
||||
/** @var Update */
|
||||
$update = $this->autoMapper->map($data, Update::class);
|
||||
|
||||
$user = $this->authService->getUser();
|
||||
$user = $this->security->getUser();
|
||||
|
||||
if (!$user) {
|
||||
throw new AuthenticationException();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user