Skip to content

Commit

Permalink
Dont reload component.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Sep 10, 2024
1 parent 68a568e commit b2cec98
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
3 changes: 1 addition & 2 deletions src/Panel/AuthPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Cake\Core\InstanceConfigTrait;
use Cake\Event\EventInterface;
use DebugKit\DebugPanel;
use RuntimeException;
use TinyAuth\Auth\AclTrait;
use TinyAuth\Auth\AllowTrait;
use TinyAuth\Utility\Config;
Expand Down Expand Up @@ -76,7 +75,7 @@ public function shutdown(EventInterface $event): void {
$this->isPublic = $this->_isActionAllowed($rule, $params['action']);

if (!$controller->components()->has('AuthUser')) {
throw new RuntimeException('You must have TinyAuth.AuthUser component installed');
$controller->loadComponent('TinyAuth.AuthUser');
}

/** @var \TinyAuth\Controller\Component\AuthUserComponent $authUserComponent */
Expand Down
4 changes: 0 additions & 4 deletions tests/TestCase/Panel/AuthPanelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public function tearDown(): void {
*/
public function testPanelRestrictedAction() {
$controller = new Controller(new ServerRequest());
$controller->loadComponent('TinyAuth.AuthUser');
$event = new Event('event', $controller);

$this->panel->shutdown($event);
Expand All @@ -87,7 +86,6 @@ public function testPanelPublicAction() {
$request = new ServerRequest(['url' => '/users']);
$request = $request->withAttribute('params', $url);
$controller = new Controller($request);
$controller->loadComponent('TinyAuth.AuthUser');
$event = new Event('event', $controller);

$this->panel->shutdown($event);
Expand Down Expand Up @@ -117,7 +115,6 @@ public function testPanelAclRestricted() {
$request = new ServerRequest(['url' => '/tags']);
$request = $request->withAttribute('params', $url);
$controller = new Controller($request);
$controller->loadComponent('TinyAuth.AuthUser');
$event = new Event('event', $controller);

$this->panel->shutdown($event);
Expand Down Expand Up @@ -150,7 +147,6 @@ public function testPanelAclAllowed() {
'role_id' => 1,
]);
$controller = new Controller($request);
$controller->loadComponent('TinyAuth.AuthUser');
$event = new Event('event', $controller);

$this->panel->shutdown($event);
Expand Down

0 comments on commit b2cec98

Please sign in to comment.