Keep configured auth transports when faking an actor (#91)
Assisted-By: Claude Fable 5.1 Co-authored-by: roxblnfk <roxblnfk@ya.ru>
This commit is contained in:
1 parent
fdcc6b7728
commit
0171b86dd8
4 files changed
+176
-3
No files matched your search
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Spiral\Testing\Tests\App\Bootloader;
|
||||
|
||||
use Spiral\Auth\Transport\HeaderTransport;
|
||||
use Spiral\Boot\Bootloader\Bootloader;
|
||||
use Spiral\Bootloader\Auth\HttpAuthBootloader;
|
||||
|
||||
/**
|
||||
* Registers an auth transport under a name that does not exist in the default auth config.
|
||||
*/
|
||||
final class CustomAuthTransportBootloader extends Bootloader
|
||||
{
|
||||
public const TRANSPORT = 'custom';
|
||||
|
||||
public function defineDependencies(): array
|
||||
{
|
||||
return [HttpAuthBootloader::class];
|
||||
}
|
||||
|
||||
public function init(HttpAuthBootloader $auth): void
|
||||
{
|
||||
$auth->addTransport(self::TRANSPORT, new HeaderTransport(header: 'X-Custom-Token'));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user