Upgrade to Laravel 9 (#4413)

Co-authored-by: DaneEveritt <dane@daneeveritt.com>
This commit is contained in:
Matthew Penner 2022-10-14 10:59:20 -06:00 committed by GitHub
parent 95e15d2c8a
commit cbcf62086f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
573 changed files with 4387 additions and 9411 deletions

View file

@ -2,9 +2,9 @@
namespace Pterodactyl\Listeners\Auth;
use Illuminate\Auth\Events\Login;
use Pterodactyl\Facades\Activity;
use Illuminate\Auth\Events\Failed;
use Pterodactyl\Events\Auth\DirectLogin;
use Illuminate\Contracts\Events\Dispatcher;
use Pterodactyl\Extensions\Illuminate\Events\Contracts\SubscribesToEvents;
@ -13,10 +13,8 @@ class AuthenticationListener implements SubscribesToEvents
/**
* Handles an authentication event by logging the user and information about
* the request.
*
* @param \Illuminate\Auth\Events\Login|\Illuminate\Auth\Events\Failed $event
*/
public function handle($event): void
public function handle(Failed|DirectLogin $event): void
{
$activity = Activity::withRequestMetadata();
if ($event->user) {
@ -35,6 +33,6 @@ class AuthenticationListener implements SubscribesToEvents
public function subscribe(Dispatcher $events): void
{
$events->listen(Failed::class, self::class);
$events->listen(Login::class, self::class);
$events->listen(DirectLogin::class, self::class);
}
}

View file

@ -15,7 +15,7 @@ class PasswordResetListener
$this->request = $request;
}
public function handle(PasswordReset $event)
public function handle(PasswordReset $event): void
{
Activity::event('event:password-reset')
->withRequestMetadata()

View file

@ -7,7 +7,7 @@ use Pterodactyl\Events\Auth\ProvidedAuthenticationToken;
class TwoFactorListener
{
public function handle(ProvidedAuthenticationToken $event)
public function handle(ProvidedAuthenticationToken $event): void
{
Activity::event($event->recovery ? 'auth:recovery-token' : 'auth:token')
->withRequestMetadata()