mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 05:14:46 +02:00
* Remove deploy.locations from validator * Change location data to optional for backwards compat * Better styling * Add back comma to follow coding style * Remove EventServiceProvider from providers file Fixes duplicated auth messages in the client Activity tab. * Add null check on $model->actor Prevents the client Activity tab page from breaking when an authentication attempt has failed. * Proper type checking on $model->actor Chose instanceof as it seems to be the best in terms of type safety. Co-authored-by: MartinOscar <40749467+RMartinOscar@users.noreply.github.com> * Revert removal of EventServiceProvider * Remove subscription of AuthenticationListener * Remove subscriptions for auth events * Remove unused import Dispatcher * Remove unused import AuthenticationListener --------- Co-authored-by: MartinOscar <40749467+RMartinOscar@users.noreply.github.com>
This commit is contained in:
parent
7dad2d0e42
commit
1c1c8c0cc6
@ -5,7 +5,6 @@ namespace App\Listeners\Auth;
|
|||||||
use App\Facades\Activity;
|
use App\Facades\Activity;
|
||||||
use Illuminate\Auth\Events\Failed;
|
use Illuminate\Auth\Events\Failed;
|
||||||
use App\Events\Auth\DirectLogin;
|
use App\Events\Auth\DirectLogin;
|
||||||
use Illuminate\Events\Dispatcher;
|
|
||||||
|
|
||||||
class AuthenticationListener
|
class AuthenticationListener
|
||||||
{
|
{
|
||||||
@ -28,10 +27,4 @@ class AuthenticationListener
|
|||||||
|
|
||||||
$activity->event($event instanceof Failed ? 'auth:fail' : 'auth:success')->log();
|
$activity->event($event instanceof Failed ? 'auth:fail' : 'auth:success')->log();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function subscribe(Dispatcher $events): void
|
|
||||||
{
|
|
||||||
$events->listen(Failed::class, self::class);
|
|
||||||
$events->listen(DirectLogin::class, self::class);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@ use App\Observers\UserObserver;
|
|||||||
use App\Observers\ServerObserver;
|
use App\Observers\ServerObserver;
|
||||||
use App\Observers\SubuserObserver;
|
use App\Observers\SubuserObserver;
|
||||||
use App\Observers\EggVariableObserver;
|
use App\Observers\EggVariableObserver;
|
||||||
use App\Listeners\Auth\AuthenticationListener;
|
|
||||||
use App\Events\Server\Installed as ServerInstalledEvent;
|
use App\Events\Server\Installed as ServerInstalledEvent;
|
||||||
use App\Notifications\ServerInstalled as ServerInstalledNotification;
|
use App\Notifications\ServerInstalled as ServerInstalledNotification;
|
||||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||||
@ -24,10 +23,6 @@ class EventServiceProvider extends ServiceProvider
|
|||||||
ServerInstalledEvent::class => [ServerInstalledNotification::class],
|
ServerInstalledEvent::class => [ServerInstalledNotification::class],
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $subscribe = [
|
|
||||||
AuthenticationListener::class,
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register any events for your application.
|
* Register any events for your application.
|
||||||
*/
|
*/
|
||||||
|
@ -55,7 +55,7 @@ class ActivityLogTransformer extends BaseClientTransformer
|
|||||||
|
|
||||||
$properties = $model->properties
|
$properties = $model->properties
|
||||||
->mapWithKeys(function ($value, $key) use ($model) {
|
->mapWithKeys(function ($value, $key) use ($model) {
|
||||||
if ($key === 'ip' && !$model->actor->is($this->request->user())) {
|
if ($key === 'ip' && $model->actor instanceof User && !$model->actor->is($this->request->user())) {
|
||||||
return [$key => '[hidden]'];
|
return [$key => '[hidden]'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,5 @@ return [
|
|||||||
App\Providers\Filament\AdminPanelProvider::class,
|
App\Providers\Filament\AdminPanelProvider::class,
|
||||||
App\Providers\RouteServiceProvider::class,
|
App\Providers\RouteServiceProvider::class,
|
||||||
App\Providers\ViewComposerServiceProvider::class,
|
App\Providers\ViewComposerServiceProvider::class,
|
||||||
|
|
||||||
SocialiteProviders\Manager\ServiceProvider::class,
|
SocialiteProviders\Manager\ServiceProvider::class,
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user