From ac36fe3051de5e927346ecfbf6a234f39ba3769f Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Thu, 29 Jan 2026 21:28:38 +0700 Subject: [PATCH] feat(auth): enforce panel access check and notify inactive users --- .agent/workflows/commit.md | 26 ++++++++++++++++++++++++++ app/Filament/Pages/Auth/Login.php | 9 +++++++++ 2 files changed, 35 insertions(+) create mode 100644 .agent/workflows/commit.md diff --git a/.agent/workflows/commit.md b/.agent/workflows/commit.md new file mode 100644 index 0000000..3386851 --- /dev/null +++ b/.agent/workflows/commit.md @@ -0,0 +1,26 @@ +--- +description: Automatic commit message generator and fast AI-powered commit for all current changes +--- + +// turbo-all + +This workflow automatically stages all changes, generates a descriptive commit message, and commits them in one go. + +### Steps: + +1. **Stage All Changes**: Automatically stage all modified and new files. + ```bash + git add . + ``` +2. **Analyze Changes**: Get the diff of staged changes to understand the context. + ```bash + git diff --cached + ``` +3. **Generate & Commit**: Generate a professional message following [Conventional Commits](https://www.conventionalcommits.org/) and execute the commit. + ```bash + git commit -m "" + ``` +4. **Push**: Optionally push the changes. + ```bash + git push + ``` \ No newline at end of file diff --git a/app/Filament/Pages/Auth/Login.php b/app/Filament/Pages/Auth/Login.php index 403980b..c6341b0 100644 --- a/app/Filament/Pages/Auth/Login.php +++ b/app/Filament/Pages/Auth/Login.php @@ -91,6 +91,15 @@ public function authenticate(): ?LoginResponse $this->throwFailureValidationException(); } + if ($user instanceof FilamentUser && (! $user->canAccessPanel(Filament::getCurrentOrDefaultPanel()))) { + CheerfulNotification::danger( + 'Akun Tidak Aktif 🚫', + 'Maaf, akun Anda saat ini tidak aktif. Silakan hubungi Administrator. 📞' + )->send(); + + throw ValidationException::withMessages([]); + } + if ( filled($this->userUndertakingMultiFactorAuthentication) && (decrypt($this->userUndertakingMultiFactorAuthentication) === $user->getAuthIdentifier())