Skip to content

Commit

Permalink
Update token repository to be in line with the parent class
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Feb 24, 2025
1 parent 062e09a commit c203d2b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Auth/Passwords/PasswordBrokerManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ protected function createTokenRepository(array $config)
$this->app['hash'],
$config['table'],
$key,
$config['expire'],
($config['expire'] ?? 60) * 60,
$config['throttle'] ?? 0
);
}
Expand Down
20 changes: 8 additions & 12 deletions src/Auth/Passwords/TokenRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,16 @@

class TokenRepository extends DatabaseTokenRepository
{
protected $files;
protected $hasher;
protected $hashKey;
protected $expires;
protected $path;

public function __construct(Filesystem $files, HasherContract $hasher, $table, $hashKey, $expires = 60, $throttle = 60)
{
$this->files = $files;
$this->hasher = $hasher;
$this->hashKey = $hashKey;
$this->expires = $expires * 60;
$this->throttle = $throttle;

public function __construct(
protected Filesystem $files,
protected HasherContract $hasher,
protected string $table,
protected string $hashKey,
protected int $expires = 3600,
protected int $throttle = 60
) {
$this->path = storage_path("statamic/password_resets/$table.yaml");
}

Expand Down

0 comments on commit c203d2b

Please sign in to comment.