Files
laraundfelix/app/Filament/Auth/TrustedDeviceChallenge.php
T
LarsandCursor b374335b3a
Deploy Test / test (push) Successful in 13s
Deploy Test / deploy (push) Successful in 23s
Benenne den Authenticator und merke denselben Browser für 30 Tage.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-15 10:15:33 +01:00

22 lines
623 B
PHP

<?php
namespace App\Filament\Auth;
use App\Auth\TrustedStaffDevice;
use App\Models\User;
use Filament\Auth\MultiFactor\Contracts\MultiFactorAuthenticationProvider;
use Filament\Auth\MultiFactor\MultiFactorChallenge;
use Illuminate\Contracts\Auth\Authenticatable;
class TrustedDeviceChallenge extends MultiFactorChallenge
{
public function getFirstEnabledProvider(Authenticatable $user): ?MultiFactorAuthenticationProvider
{
if ($user instanceof User && app(TrustedStaffDevice::class)->isTrusted($user)) {
return null;
}
return parent::getFirstEnabledProvider($user);
}
}