1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2025-02-24 07:00:46 +00:00

Merge pull request #5712 from intentionally-left-nil/fix-pulse-crash

Prevent pulse crash when it is not configured
This commit is contained in:
daniel 2025-02-09 06:05:13 -07:00 committed by GitHub
commit 2bbe7c9d04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -74,19 +74,21 @@ class AppServiceProvider extends ServiceProvider
return $user->is_admin === 1;
});
Pulse::user(function ($user) {
$acct = AccountService::get($user->profile_id, true);
if (config('pulse.enabled', false)) {
Pulse::user(function ($user) {
$acct = AccountService::get($user->profile_id, true);
return $acct ? [
'name' => $acct['username'],
'extra' => $user->email,
'avatar' => $acct['avatar'],
] : [
'name' => $user->username,
'extra' => 'DELETED',
'avatar' => '/storage/avatars/default.jpg',
];
});
return $acct ? [
'name' => $acct['username'],
'extra' => $user->email,
'avatar' => $acct['avatar'],
] : [
'name' => $user->username,
'extra' => 'DELETED',
'avatar' => '/storage/avatars/default.jpg',
];
});
}
RateLimiter::for('app-signup', function (Request $request) {
return Limit::perDay(10)->by($request->ip());