Skip to content

Commit 65c7700

Browse files
committed
Auth0 resetter
1 parent 0f19226 commit 65c7700

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SpeedPuzzling\Web\Services;
6+
7+
use Auth0\Symfony\Service;
8+
use Symfony\Contracts\Service\ResetInterface;
9+
10+
final class Auth0ServiceResetter implements ResetInterface
11+
{
12+
public function __construct(
13+
private readonly Service $auth0Service,
14+
) {
15+
}
16+
17+
public function reset(): void
18+
{
19+
$reflection = new \ReflectionClass($this->auth0Service);
20+
$property = $reflection->getProperty('sdk');
21+
$property->setValue($this->auth0Service, null);
22+
}
23+
}

0 commit comments

Comments
 (0)