Skip to content

Commit

Permalink
Fix een paar bugs die naar boven kwamen in prod
Browse files Browse the repository at this point in the history
Een paar dingetjes die ik nog over het hoofd had gezien:

1. `AbstractToken::setAuthenticated` bestaat niet meer. Alle tokens zijn
	 nu altijd authenticated.
2. `$this->get(...)` voor Controllers bestaat niet meer. Gebruik de
	 container.
  • Loading branch information
NathanHuisman committed Feb 8, 2025
1 parent 8e12a4e commit 37c1a72
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions lib/common/Security/PrivateTokenToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ public function __construct(UserInterface $user, array $roles = [])
parent::__construct($roles);

$this->setUser($user);
$this->setAuthenticated(true);
}

public function getCredentials()
public function getCredentials(): mixed
{
return '';
}
Expand Down
4 changes: 2 additions & 2 deletions lib/controller/AbstractController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function getSubscribedServices(): array
*/
protected function getDataTableSelection(): array
{
$selection = $this->get('request_stack')
$selection = $this->container->get('request_stack')
->getCurrentRequest()
->request->filter(DataTable::POST_SELECTION, [], FILTER_SANITIZE_STRING);

Expand All @@ -52,7 +52,7 @@ protected function getDataTableSelection(): array
protected function tableData($data, $groups = null): GenericDataTableResponse
{
return new GenericDataTableResponse(
$this->get('serializer'),
$this->container->get('serializer'),
$data,
null,
null,
Expand Down
2 changes: 1 addition & 1 deletion lib/controller/ErrorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function handleException(
case Response::HTTP_FORBIDDEN:
if ($this->getUser() == null) {
$requestUri = $request->getRequestUri();
$router = $this->get('router');
$router = $this->container->get('router');

$this->saveTargetPath($request->getSession(), 'main', $requestUri);

Expand Down

0 comments on commit 37c1a72

Please sign in to comment.