mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 18:44:16 +00:00
🤖 Auto commit for release 'develop' on 2025-06-12
This commit is contained in:
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user