diff --git a/app/Filament/Pages/Auth/Login.php b/app/Filament/Pages/Auth/Login.php index 687eb58..1033496 100644 --- a/app/Filament/Pages/Auth/Login.php +++ b/app/Filament/Pages/Auth/Login.php @@ -2,6 +2,7 @@ namespace App\Filament\Pages\Auth; +use App\Enums\IsActive; use App\Filament\Support\SystemNotification; use DanHarrin\LivewireRateLimiting\Exceptions\TooManyRequestsException; use DiogoGPinto\AuthUIEnhancer\Pages\Auth\Concerns\HasCustomLayout; @@ -92,6 +93,17 @@ public function authenticate(): ?LoginResponse $this->throwFailureValidationException(); } + if ($user->is_active === IsActive::Inactive) { + SystemNotification::danger( + 'Akses Ditangguhkan ⛔', + 'Maaf, Anda tidak dapat masuk karena status akun saat ini sedang tidak aktif. Silakan hubungi Administrator untuk informasi lebih lanjut. 😴' + )->send(); + + throw ValidationException::withMessages([ + 'login' => 'Akun Anda sedang dinonaktifkan.', + ]); + } + if ( filled($this->userUndertakingMultiFactorAuthentication) && (decrypt($this->userUndertakingMultiFactorAuthentication) === $user->getAuthIdentifier())