Skip to content

Commit 37c1a72

Browse files
committed
Fix een paar bugs die naar boven kwamen in prod
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.
1 parent 8e12a4e commit 37c1a72

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

lib/common/Security/PrivateTokenToken.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ public function __construct(UserInterface $user, array $roles = [])
1212
parent::__construct($roles);
1313

1414
$this->setUser($user);
15-
$this->setAuthenticated(true);
1615
}
1716

18-
public function getCredentials()
17+
public function getCredentials(): mixed
1918
{
2019
return '';
2120
}

lib/controller/AbstractController.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static function getSubscribedServices(): array
3838
*/
3939
protected function getDataTableSelection(): array
4040
{
41-
$selection = $this->get('request_stack')
41+
$selection = $this->container->get('request_stack')
4242
->getCurrentRequest()
4343
->request->filter(DataTable::POST_SELECTION, [], FILTER_SANITIZE_STRING);
4444

@@ -52,7 +52,7 @@ protected function getDataTableSelection(): array
5252
protected function tableData($data, $groups = null): GenericDataTableResponse
5353
{
5454
return new GenericDataTableResponse(
55-
$this->get('serializer'),
55+
$this->container->get('serializer'),
5656
$data,
5757
null,
5858
null,

lib/controller/ErrorController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function handleException(
4545
case Response::HTTP_FORBIDDEN:
4646
if ($this->getUser() == null) {
4747
$requestUri = $request->getRequestUri();
48-
$router = $this->get('router');
48+
$router = $this->container->get('router');
4949

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

0 commit comments

Comments
 (0)