🤖 Auto commit for release 'develop' on 2025-06-12

This commit is contained in:
JC5
2025-06-12 15:41:41 +02:00
parent 3bfc12f93b
commit 657b95485c
6 changed files with 39 additions and 38 deletions

View File

@@ -162,7 +162,7 @@ class AccountController extends Controller
$defaultSet = $this->repository->getAccountsByType([AccountTypeEnum::ASSET->value])->pluck('id')->toArray();
/** @var Preference $frontpage */
$frontpage = Preferences::get('frontpageAccounts', $defaultSet);
$frontpage = Preferences::get('frontpageAccounts', $defaultSet);
if (!(is_array($frontpage->data) && count($frontpage->data) > 0)) {
$frontpage->data = $defaultSet;

View File

@@ -59,11 +59,12 @@ use function Safe\parse_url;
class Handler extends ExceptionHandler
{
public static ?Throwable $lastError = null;
/**
* @var array<int, class-string<Throwable>>
*/
protected $dontReport
= [
= [
AuthenticationException::class,
LaravelValidationException::class,
NotFoundHttpException::class,
@@ -217,13 +218,13 @@ class Handler extends ExceptionHandler
public function report(Throwable $e): void
{
self::$lastError = $e;
$doMailError = (bool) config('firefly.send_error_message');
$doMailError = (bool) config('firefly.send_error_message');
if ($this->shouldntReportLocal($e) || !$doMailError) {
parent::report($e);
return;
}
$userData = [
$userData = [
'id' => 0,
'email' => 'unknown@example.com',
];
@@ -232,9 +233,9 @@ class Handler extends ExceptionHandler
$userData['email'] = auth()->user()->email;
}
$headers = request()->headers->all();
$headers = request()->headers->all();
$data = [
$data = [
'class' => $e::class,
'errorMessage' => $e->getMessage(),
'time' => Carbon::now()->format('r'),
@@ -252,8 +253,8 @@ class Handler extends ExceptionHandler
];
// create job that will mail.
$ipAddress = request()->ip() ?? '0.0.0.0';
$job = new MailError($userData, (string) config('firefly.site_owner'), $ipAddress, $data);
$ipAddress = request()->ip() ?? '0.0.0.0';
$job = new MailError($userData, (string) config('firefly.site_owner'), $ipAddress, $data);
dispatch($job);
parent::report($e);

View File

@@ -101,6 +101,7 @@ class Authenticate
if ($result) {
$user = $this->auth->guard($guard)->user();
$this->validateBlockedUser($user, $guards);
// According to PHPstan the method returns void, but we'll see.
return $this->auth->shouldUse($guard); // @phpstan-ignore-line
}
@@ -109,7 +110,7 @@ class Authenticate
// this is a massive hack, but if the hander has the oauth exception
// at this point we can report its error instead of a generic one.
$message = 'Unauthenticated.';
if(Handler::$lastError instanceof OAuthServerException) {
if (Handler::$lastError instanceof OAuthServerException) {
$message = Handler::$lastError->getHint();
}