mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-06 06:15:51 -05:00
typed config
This commit is contained in:
@@ -8,7 +8,6 @@ use Exception;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
use Pterodactyl\Contracts\Users\SetsUpTwoFactor;
|
||||
use Pterodactyl\Models\User;
|
||||
use Pterodactyl\Support\JsonValueGuard;
|
||||
use RuntimeException;
|
||||
|
||||
final readonly class SetupTwoFactor implements SetsUpTwoFactor
|
||||
@@ -26,7 +25,7 @@ final readonly class SetupTwoFactor implements SetsUpTwoFactor
|
||||
{
|
||||
$secret = '';
|
||||
try {
|
||||
for ($i = 0; $i < JsonValueGuard::integer(config('pterodactyl.auth.2fa.bytes', 16)); $i++) {
|
||||
for ($i = 0; $i < config()->integer('pterodactyl.auth.2fa.bytes', 16); $i++) {
|
||||
$secret .= mb_substr(self::VALID_BASE32_CHARACTERS, random_int(0, 31), 1);
|
||||
}
|
||||
} catch (Exception $exception) {
|
||||
@@ -35,7 +34,7 @@ final readonly class SetupTwoFactor implements SetsUpTwoFactor
|
||||
|
||||
$user->update(['totp_secret' => Crypt::encrypt($secret)]);
|
||||
|
||||
$company = urlencode(preg_replace('/\s/', '', JsonValueGuard::string(config('app.name'))) ?? '');
|
||||
$company = urlencode(preg_replace('/\s/', '', config()->string('app.name')) ?? '');
|
||||
|
||||
return [
|
||||
'image_url_data' => sprintf(
|
||||
|
||||
Reference in New Issue
Block a user