Fix pint issues

This commit is contained in:
Bubka 2025-03-27 17:19:57 +01:00
parent ad43aa777b
commit e624995ebc
12 changed files with 25 additions and 29 deletions

View File

@ -131,8 +131,7 @@ class GroupController extends Controller
// are not assigned to any group record. // are not assigned to any group record.
if ($group->id === 0) { if ($group->id === 0) {
$twofaccounts = $request->user()->twofaccounts; $twofaccounts = $request->user()->twofaccounts;
} } else {
else {
$twofaccounts = $group->twofaccounts; $twofaccounts = $group->twofaccounts;
} }

View File

@ -28,7 +28,7 @@ class SinglePageController extends Controller
$publicSettings = $appSettings->only([ $publicSettings = $appSettings->only([
'disableRegistration', 'disableRegistration',
'enableSso', 'enableSso',
'useSsoOnly' 'useSsoOnly',
]); ]);
$settings = $appSettings->map(function (mixed $item, string $key) { $settings = $appSettings->map(function (mixed $item, string $key) {
return null; return null;

View File

@ -117,8 +117,7 @@ class Group extends Model
$group->id = 0; $group->id = 0;
return $group; return $group;
} } else {
else {
return parent::resolveRouteBinding($value, $field); return parent::resolveRouteBinding($value, $field);
} }
} }

View File

@ -431,12 +431,10 @@ class TwoFAccount extends Model implements Sortable
$OtpDto->otp_type = $this->otp_type; $OtpDto->otp_type = $this->otp_type;
$OtpDto->generated_at = $time ?: time(); $OtpDto->generated_at = $time ?: time();
$expires_in = $this->generator->expiresIn(); /** @phpstan-ignore-line - expiresIn() is in the TOTPInterface only */ $expires_in = $this->generator->expiresIn(); /** @phpstan-ignore-line - expiresIn() is in the TOTPInterface only */
if ($this->otp_type === self::TOTP) { if ($this->otp_type === self::TOTP) {
$OtpDto->password = $this->generator->at($OtpDto->generated_at); $OtpDto->password = $this->generator->at($OtpDto->generated_at);
$OtpDto->next_password = $this->generator->at($OtpDto->generated_at + $expires_in + 2); $OtpDto->next_password = $this->generator->at($OtpDto->generated_at + $expires_in + 2);
} } else {
else {
$OtpDto->password = SteamTotp::getAuthCode(base64_encode(Base32::decodeUpper($this->secret))); $OtpDto->password = SteamTotp::getAuthCode(base64_encode(Base32::decodeUpper($this->secret)));
$OtpDto->next_password = SteamTotp::getAuthCode(base64_encode(Base32::decodeUpper($this->secret)), $expires_in + 2); $OtpDto->next_password = SteamTotp::getAuthCode(base64_encode(Base32::decodeUpper($this->secret)), $expires_in + 2);
} }