mirror of
https://github.com/pelican-dev/panel.git
synced 2025-08-03 01:02:13 +02:00
Use filaments password broker for reset link token when creating subuser (#1498)
This commit is contained in:
parent
340d1b543c
commit
9f2305f351
@ -7,15 +7,16 @@ use Ramsey\Uuid\Uuid;
|
|||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Contracts\Hashing\Hasher;
|
use Illuminate\Contracts\Hashing\Hasher;
|
||||||
use Illuminate\Database\ConnectionInterface;
|
use Illuminate\Database\ConnectionInterface;
|
||||||
use Illuminate\Contracts\Auth\PasswordBroker;
|
|
||||||
use App\Notifications\AccountCreated;
|
use App\Notifications\AccountCreated;
|
||||||
|
use Filament\Facades\Filament;
|
||||||
|
use Illuminate\Auth\Passwords\PasswordBroker;
|
||||||
|
use Illuminate\Support\Facades\Password;
|
||||||
|
|
||||||
class UserCreationService
|
class UserCreationService
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly ConnectionInterface $connection,
|
private readonly ConnectionInterface $connection,
|
||||||
private readonly Hasher $hasher,
|
private readonly Hasher $hasher,
|
||||||
private readonly PasswordBroker $passwordBroker,
|
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -51,7 +52,9 @@ class UserCreationService
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($generateResetToken)) {
|
if (isset($generateResetToken)) {
|
||||||
$token = $this->passwordBroker->createToken($user);
|
/** @var PasswordBroker $broker */
|
||||||
|
$broker = Password::broker(Filament::getPanel('app')->getAuthPasswordBroker());
|
||||||
|
$token = $broker->createToken($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->connection->commit();
|
$this->connection->commit();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user